Posts tagged "component"

CQ5.5: NullPointerException trying to reference an OSGi component/service using SCR annotations

Issue

If you are trying to reference an OSGi service or component using the SCR annotations, like the SlingRepository in the code below, then you may encounter a NullPointerException when you try to use these objects.

 /**
  * @scr.component immediate="true"
  * @scr.service interface="SampleService"
  */
 public class SampleServiceImpl implements SampleService {
     /**
      * @scr.reference
      */
     private SlingRepository repository;
...

Another symptom of this problem is that your SampleService component may not show up or register correctly in the CQ5 Web Console “components” tab (http://<server>:<port>/system/console/components).

Reason

The SCR annotations are deprecated in the latest builds of Apache Felix.

You should note that CRXDE and CRXDE Lite are both configured to automatically resolve these annotations and build the relevant XML files for you.  In other IDE environments you will have to include the maven-scr-plugin to resolve these annotations and build the XML files yourself.

Solution

To correctly reference these objects in the latest versions you should use the following syntax (note: you will have to explicitly import the Felix scr classes):

 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.felix.scr.annotations.Reference;

 @Component(immediate="true")
 @Service(interface="SampleService")

 public class SampleServiceImpl implements SampleService {

     @Reference
     private SlingRepository repository;
...
VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 5.0/10 (2 votes cast)

LiveCycle Designer: XFAImageService error importing a Photoshop JPG into an XFA form

Issue

 If you are trying to import JPEG images produced with Adobe Photoshop into an XFA-based form in LiveCycle Designer, then you may notice the following error in the warning palette:

Error reading JPeg file : JFIF supports only 1 and 3 component streams. 

XFAImageService: Image cannot be resolved for node: StaticImage1

Solutions

 1. Use Photoshop version 6 or less to produce the JPEG images

2. Re-save the JPEG images from Photoshop using the “Save for Web…” option in the File menu

3. Re-save the JPEG images using Paint in windows, or any other image editing tool which does not add the preview information described below

Additional information

 This error occurs when Photoshop 7 or greater was used to create the JPEG images.  This is due to a change in the JPEG format produced with Photoshop 7 and greater, which now includes a thumbnail preview of the JPEG image included in the JPEG profile.  Such profile information does conform to the JPEG/JFIF specification, however some applications like web browsers, or in this case, LiveCycle Designer cannot handle the preview data correctly.

Further information can be found below:

http://photo.net/ps7-problems.html

reference: (182368249)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 7.7/10 (3 votes cast)

LiveCycle ES: ALC-DSC-119-000: InvalidCoercionException using a custom component

Issue

The exception below occurs when using a custom component (DSC) in LiveCycle ES 8.2.1 designed to extend the functionality provided by the services from Adobe. The component includes the TaskManager DSC JAR file.

####<09-Jul-2010 15:04:21 o'clock CEST> <Error> <com.adobe.workflow.AWS> <PI> <server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> 
<<anonymous>> <BEA1-2CB96822045F171B0B4D> <> <1278680661381> <000000> <stalling action-instance: 2101 with message: Cannot coerce object: 
com.adobe.idp.taskmanager.dsc.userservice.UserServiceInfo@33142fb of type: com.adobe.idp.taskmanager.dsc.userservice.UserServiceInfo to type: 
class com.adobe.idp.taskmanager.dsc.userservice.UserServiceInfo:

ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: com.adobe.idp.taskmanager.dsc.userservice.UserServiceInfo@33142fb of type: 
com.adobe.idp.taskmanager.dsc.userservice.UserServiceInfo to type: class com.adobe.idp.taskmanager.dsc.userservice.UserServiceInfo
at com.adobe.idp.dsc.util.CoercionUtil.toType(CoercionUtil.java:1047)
at com.adobe.workflow.datatype.CoercionUtil.toType(CoercionUtil.java:168)
at com.adobe.workflow.engine.PEUtil.processMapping(PEUtil.java:968)
at com.adobe.workflow.engine.PEUtil.invokeAction(PEUtil.java:666)
at com.adobe.workflow.engine.SynchronousBranch.handleInvokeAction(SynchronousBranch.java:466)
at com.adobe.workflow.engine.SynchronousBranch.execute(SynchronousBranch.java:863)
at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBean.java:2773)
at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncInvokeProcessCommand(ProcessEngineBMTBean.java:704)
at com.adobe.workflow.engine.adobe_ProcessEngineBMTEJB_e5zjcz_ELOImpl.asyncInvokeProcessCommand(adobe_ProcessEngineBMTEJB_e5zjcz_ELOImpl.java:1697)
at com.adobe.workflow.engine.ProcessCommandControllerBean.doOnMessage(ProcessCommandControllerBean.java:156)
at com.adobe.workflow.engine.ProcessCommandControllerBean.onMessage(ProcessCommandControllerBean.java:99)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4072)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:3962)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4490)
at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

Reason

This error occurs when you include the TaskManager DSC JAR in your component. The TaskManager DSC (that is, the service itself) is not meant for use as a library.

Solution

Remove the TaskManager JAR from your component and use the libraries provided with the SDK. Or, extract any required classes from the DSC JAR and include them in your component.

reference (181617740/2660587)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 1.0/10 (1 vote cast)