Thursday, July 22, 2010

Workflow job in jahia 6.1 fails on WebSphere

My jahia 6.1 site running on a WebSphere Application Server 6.1.0.29 was giving the following errors when workflowing a page:


[22/07/10 11:59:28:392 CEST] 0000004b SystemOut     O 2010-07-22 11:59:28,391: INFO  [BackgroundJob] - execute Background job BackgroundJob-a62d9921-ec0b-4f31-9256-ca716c3f2bb8
 started @ Thu Jul 22 11:59:28 CEST 2010
[22/07/10 11:59:28:395 CEST] 0000004b SystemOut     O 2010-07-22 11:59:28,394: ERROR [BackgroundJob] - Cannot execute job
java.lang.NullPointerException
 at org.jahia.services.usermanager.JahiaUserManagerDBProvider.lookupUserByKey(JahiaUserManagerDBProvider.java:462)
 at org.jahia.services.usermanager.JahiaUserManagerRoutingService$7.execute(JahiaUserManagerRoutingService.java:301)
 at org.jahia.services.usermanager.JahiaUserManagerRoutingService$7.execute(JahiaUserManagerRoutingService.java:300)
 at org.jahia.services.usermanager.JahiaUserManagerRoutingService.routeCallAllUntilSuccess(JahiaUserManagerRoutingService.java:433)
 at org.jahia.services.usermanager.JahiaUserManagerRoutingService.lookupUserByKey(JahiaUserManagerRoutingService.java:299)
 at org.jahia.services.usermanager.JahiaUserManagerRoutingService$$FastClassByCGLIB$$d7ce26b5.invoke()
 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
 at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
 at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
 at org.jahia.services.usermanager.JahiaUserManagerRoutingService$$EnhancerByCGLIB$$be1b2945.lookupUserByKey()
 at org.jahia.services.scheduler.BackgroundJob.getProcessingContextFromBackgroundJobDataMap(BackgroundJob.java:228)
 at org.jahia.services.scheduler.BackgroundJob.execute(BackgroundJob.java:147)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[22/07/10 11:59:28:397 CEST] 0000004b SystemOut     O 2010-07-22 11:59:28,397: ERROR [JobRunShell] - Job ActivationJob.BackgroundJob-a62d9921-ec0b-4f31-9256-ca716c3f2bb8 threw an unhandled Exception: 
java.lang.NullPointerException
 at org.jahia.services.scheduler.BackgroundJob.execute(BackgroundJob.java:166)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[22/07/10 11:59:28:397 CEST] 0000004b SystemOut     O 2010-07-22 11:59:28,397: ERROR [ErrorLogger] - Job (ActivationJob.BackgroundJob-a62d9921-ec0b-4f31-9256-ca716c3f2bb8 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
 at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.NullPointerException
 at org.jahia.services.scheduler.BackgroundJob.execute(BackgroundJob.java:166)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

After some debugging I found the cause:

the quartz jobstore driverDelegateClass was set to 'MSSQLDelegate' (as MS SQLServer is the database I used when installing, so I assume th jahia installer put this value in automatically). When changing this driver to the standard delegate 'StdJDBCDelegate', the quartz job executed without problems.

The driveDelegateClass can be set in WEB-INF/etc/config/quartz.properties using the property "org.quartz.jobStore.driverDelegateClass".

The userkey (stored in the JobDataMap of quartz) was null when the job got executed, but was set correctly when defining the job. Because the mssql driver does not seem to work correctly on WAS, the JobExecutionContext did no longer hold these values in its JobDataMap when the job got executed.

No comments:

Post a Comment