Posts tagged "NullPointerException"

CRX 2.2: DelegatingObservationDispatcher: Error while dispatching events… java.lang.NullPointerException

Issue

If you are using CQ5.3/CRX2.2 you may notice the following error in the log files:

*ERROR* DelegatingObservationDispatcher: Error while dispatching events. (DelegatingObservationDispatcher.java, line 129)
 java.lang.NullPointerException
  at org.apache.jackrabbit.core.security.authorization.acl.CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:215)
  at org.apache.jackrabbit.core.security.DefaultAccessManager.canRead(DefaultAccessManager.java:251)
  at org.apache.jackrabbit.core.observation.EventConsumer.canRead(EventConsumer.java:306)
  at org.apache.jackrabbit.core.observation.EventConsumer.prepareEvents(EventConsumer.java:158)
  at org.apache.jackrabbit.core.observation.ObservationDispatcher.prepareEvents(ObservationDispatcher.java:184)
  at org.apache.jackrabbit.core.observation.EventStateCollection.prepare(EventStateCollection.java:459)
  at org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher.dispatch(DelegatingObservationDispatcher.java:126)
  at org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher.dispatchEvents(DelegatingObservationDispatcher.java:99)
  at org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:475)
 ...

Reason

This error occurs due to an issue in Jackrabbit issue: https://issues.apache.org/jira/browse/JCR-3272.

It occurs as the canRead() method in CompiledPermissionsImpl.java is checking for read access on an item that does not exist anymore.  It should therefore throw a RepositoryException, instead of resulting in an NPE.

We have had previous reports of this issue, but it did not have any effect on the server state or stability. In the later hotfixpacks for CRX, this NPE will be logged at the WARN level and not ERROR.

Solution

This has been fixed in a later release of the Jackrabbit core, version 2.4.  You can ignore this error or apply the latest crx-hotfixpack from PackageShare to resolve the problem.

reference: (43919/CRX-4113)

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

CQ5.5: SlingException running workflowreport.html

Issue

If you are using the workflow report under /etc/reports/workflowreport.html it may return with an error 500 in the browser and the following exception:

org.apache.sling.api.SlingException:
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInternal(JspServletWrapper.java:686)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:603)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:528)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:447)

Caused by: org.apache.sling.api.SlingException: An exception occurred processing JSP page /libs/cq/workflow/components/report/report.jsp at line 132
… 74 more
Caused by: java.lang.NullPointerException
    at org.apache.jsp.libs.cq.workflow.components.report.report_jsp._jspService(report_jsp.java:309)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:497)
… 97 more

Reason

This problem can occur when a workflow model is deleted, but that workflow model had been used to start multiple processes, and therefore workflow statistics for that model exist.  This is a product issue and has been addressed in CQ5.6.

Workaround

As a workaround you can use the attached overlay for
/apps/cq/workflow/components/report/report.jsp
instead of the problematic
/libs/cq/workflow/components/report/report.jsp

workflow_report_overlay_40332-1.0.zip

The workaround will resolve the NullPointerException and the workflow report will display as expected, but there are still some unresolved exceptions in the server log. These will be resolved with the full product fix.

reference: (40332/CQ5-23798)

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

CQ5.5 SP2.1: IllegalArgumentException: Servlet must not be null

Issue

If you are updating your CQ5.5 installation to SP2.1 on an application server you may notice the following exception in the logs:

12.11.2012 03:20:21.683 *ERROR* [CQSE HTTP Service] org.apache.felix.http.whiteboard Failed to register servlet
java.lang.IllegalArgumentException: Servlet must not be null
    at org.apache.felix.http.base.internal.service.HttpServiceImpl.registerServlet(HttpServiceImpl.java:88)
    at org.apache.felix.http.whiteboard.internal.manager.ServletMapping.register(ServletMapping.java:54)
    at org.apache.felix.http.whiteboard.internal.manager.ExtenderManager.registerAll(ExtenderManager.java:235)
    at org.apache.felix.http.whiteboard.internal.manager.ExtenderManager.setHttpService(ExtenderManager.java:195)
    at org.apache.felix.http.whiteboard.internal.tracker.HttpServiceTracker.added(HttpServiceTracker.java:37)

After restarting the server you may notice the following errors in the log:

12.11.2012 03:22:14.621 *ERROR* [Thread-1] org.apache.sling.servlets.resolver.internal.SlingServletResolver bindServlet: Unexpected problem initializing component com.day.cq.opensocial.gadgets.servlet.ConcatProxyServlet com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting method, java.lang.IllegalStateException: Servlet already initialized
    at org.apache.shindig.gadgets.servlet.ConcatProxyServlet.setConcatUriManager(ConcatProxyServlet.java:90)
    while locating com.day.cq.opensocial.gadgets.servlet.ConcatProxyServlet
Caused by: java.lang.IllegalStateException: Servlet already initialized
    at com.google.common.base.Preconditions.checkState(Preconditions.java:145)
    at org.apache.shindig.common.servlet.InjectedServlet.checkInitialized(InjectedServlet.java:59)
    at org.apache.shindig.gadgets.servlet.ConcatProxyServlet.setConcatUriManager(ConcatProxyServlet.java:90)

12.11.2012 03:23:10.151 *ERROR* [FelixStartLevel] com.day.cq.wcm.cq-wcm-mobile-core [com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter] The bindStats method has thrown an exception (java.lang.NullPointerException) java.lang.NullPointerException
    at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.bindStats(RedirectFilter.java:173)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
    at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
    at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)

Reason

These errors occur due to the files for the CQ Servlet Engine which are still deployed.  These files should not be included when deploying CQ to an application server, and there is a step in the SP2.1 release notes describing this.

Solution

  1. Go to /crx/explorer and open the Content Explorer
  2. Go to /libs/system/install, delete the cqse-httpservice-4.1.32.jar node and save your changes
  3. Restart the instance

These steps are listed in the release notes for SP2.1 when deploying to an application server:

http://dev.day.com/docs/en/cq/current/release_notes_service_pack_2.html

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

CQ5.5: NullPointerException for wcm-mobile-core after installing SP1 or SP2.1

Issue

If you have installed CQ 5.5 SP1 or SP2.1 and restarted the instance you may notice the following exception in the logs on startup:

ERROR [Background Update com.day.cq.wcm.cq-wcm-mobile-core (219)] com.day.cq.wcm.cq-wcm-mobile-core [com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter]
The bindStats method has thrown an exception (java.lang.NullPointerException) java.lang.NullPointerException
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.bindStats(RedirectFilter.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
at org.apache.felix.scr.impl.helper.BaseMethod$NotResolved.invoke(BaseMethod.java:548)
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)

Reason

This error is caused by an issue in the mobile redirect servlet in SP1 and SP2.1.  It will only affect this servlet, which gathers usage statistics on various categories of mobile devices.

Solution

If you do not require a fix for this servlet you can ignore this error.  The issue is currently scheduled to be fixed in the next service pack for CQ5.5.  If you require an urgent solution to this issue you can contact support through Daycare.

reference: (CQ5-18788/NPR-2071)

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

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 ES: NullPointerException importing a process XML into Workbench

Issue

 If you are using Workbench 8.2.1 to import a process XML, you may encounter the following error:

java.lang.NullPointerException
at com.adobe.workflow.eclipse.editors.WorkflowEditor.createPartControl(WorkflowEditor.java:610)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:183)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:153)
at com.adobe.workflow.eclipse.editors.WorkflowMultiPageEditor.createMainBranchPage(WorkflowMultiPageEditor.java:739)
at com.adobe.workflow.eclipse.editors.WorkflowMultiPageEditor.createMainBranchPage(WorkflowMultiPageEditor.java:687)
at com.adobe.workflow.eclipse.editors.WorkflowMultiPageEditor.createPages(WorkflowMultiPageEditor.java:225)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:276)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)

Reason

This error occurs when the process XML is corrupted, and in particular, when there are negative coordinates in the positioning of objects. Each object on a process/orchestration map has x- and y-coordinates to position it on the canvas. These coordinates must be positive values to appear on the canvas.  If any of these values are negative, then the object is positioned off the canvas and isn’t editable in Workbench.

This issue has been fixed in later versions of Workbench.

Solution

There is a patch for Workbench 8.2.1.2 that produces a better error message to show the user exactly what objects have issues in the process XML. You can then edit the process XML in a text editor and replace the negative value (for example, =”-12″) with a positive value (for example, =”12″).  This edit allows the process to be imported without errors.

reference: (181599834/2630027)

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

LiveCycleES: NullPointerException trying to upgrade a LC7 process in Workbench

Issue

When trying to upgrade a LC7 process in Workbench, which is working fine under the LC7 compatibility layer you may receive an internal error in the upgrade report, with the following exception in the detail dialog:

java.lang.NullPointerException
at com.adobe.workflow.template.document.AbstractRouteTemplate.copyToAction(AbstractRouteTemplate.java:90)
at com.adobe.lcide.upgrade.lc8.dom.impl.ProcessRepositoryImpl.copyOutRoutes(Unknown Source)
at com.adobe.lcide.upgrade.lc8.dom.impl.ProcessRepositoryImpl.copyRouteInformationToBranch(Unknown Source)
at com.adobe.lcide.upgrade.lc8.dom.impl.ProcessRepositoryImpl.processBranch(Unknown Source)
at com.adobe.lcide.upgrade.lc8.dom.impl.ProcessRepositoryImpl.orchestrateProcess(Unknown Source)
at com.adobe.lcide.upgrade.lc8.app.UpgradeEngine.performUpgrade(Unknown Source)
at com.adobe.lcide.upgrade.lc8.pres.wizard.page.UpgradePageModel$UpgradeJob.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

Troubleshooting

This will be related to a particular QPAC in the process which does not have the correct mapping file for the Upgrade Process Tool.  The report will show you on which QPAC the exception occurred, or you can remove each QPAC from the process one after the other, and re-test to isolate the problem QPAC.

Solution

Once you know what QPAC causes the issue, you should ensure you have the current upgrade mapping file for that QPAC loaded in Workbench.  If the QPAC is from another vendor, then contact that vendor for the latest mapping file, and load it into Workbench under Preferences -> Upgrade Process Tool.

reference: (180890412/2324824)

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