I am using quartz 1.6.4 and websphere 6.1.
I have jobs defined as ejb.At trigger time, the JobSessionInvoker (normal java class which extends QuartzJobBean ) looks up for the job(ejb) and executes it .This works fine if the ejb is not secure.
If the job is made secured, it is not getting invoked and the below exception is thrown
[7/7/10 11:53:20:919 IST] 0000083f SecurityColla A SECJ0053E: Authorization failed for /UNAUTHENTICATED while invoking (Home)client/ClientJobSessionBean create:2 securityName: /UNAUTHENTICATED;accessID: UNAUTHENTICATED is not granted any of the required roles: User
[7/7/10 11:53:20:920 IST] 0000083f JobRunShell I org.quartz.core.JobRunShell run Job statelessJobGroup.statelessJob threw a JobExecutionException:
org.quartz.JobExecutionException: CORBA NO_PERMISSION 0x0 No; nested exception is:
org.omg.CORBA.NO_PERMISSION: java.rmi.AccessException: ; nested exception is:
com.ibm.websphere.csi.CSIAccessException: SECJ0053E: Authorization failed for /UNAUTHENTICATED while invoking (Home)client/ClientJobSessionBean create:2 securityName: /UNAUTHENTICATED;accessID: UNAUTHENTICATED is not granted any of the required roles: User vmcid: 0x0 minor code: 0 completed: No [See nested exception: java.rmi.AccessException: CORBA NO_PERMISSION 0x0 No; nested exception is:
org.omg.CORBA.NO_PERMISSION: java.rmi.AccessException: ; nested exception is:
com.ibm.websphere.csi.CSIAccessException: SECJ0053E: Authorization failed for /UNAUTHENTICATED while invoking (Home)client/ClientJobSessionBean create:2 securityName: /UNAUTHENTICATED;accessID: UNAUTHENTICATED is not granted any of the required roles: User vmcid: 0x0 minor code: 0 completed: No]
at .JobSessionInvoker.executeInternal(JobSessionInvoker.java:70)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.rmi.AccessException: CORBA NO_PERMISSION 0x0 No; nested exception is:
org.omg.CORBA.NO_PERMISSION: java.rmi.AccessException: ; nested exception is:
com.ibm.websphere.csi.CSIAccessException: SECJ0053E: Authorization failed for /UNAUTHENTICATED while invoking (Home)client/ClientJobSessionBean create:2 securityName: /UNAUTHENTICATED;accessID: UNAUTHENTICATED is not granted any of the required roles: User vmcid: 0x0 minor code: 0 completed: No
at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:269)
at com.ibm.CORBA.iiop.UtilDelegateImpl.wrapException(UtilDelegateImpl.java:752)
at javax.rmi.CORBA.Util.wrapException(Util.java:296)
at .jobsession._JobSessionHome_Stub.create(Unknown Source)
at .JobSessionInvoker.getJobSessionBean(JobSessionInvoker.java:111)
at .JobSessionInvoker.executeInternal(JobSessionInvoker.java:55)
... 3 more
Caused by: org.omg.CORBA.NO_PERMISSION: java.rmi.AccessException: ; nested exception is:
com.ibm.websphere.csi.CSIAccessException: SECJ0053E: Authorization failed for /UNAUTHENTICATED while invoking (Home)client/ClientJobSessionBean create:2 securityName: /UNAUTHENTICATED;accessID: UNAUTHENTICATED is not granted any of the required roles: User vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:522)
at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:341)
at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:757)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1161)
at $Proxy147.create(Unknown Source)
... 6 more
You will need to have the job that is invoking the EJB authenticate the thread before attempting to invoke the EJB (because the EJB apparently has authentication requirements configured for it).
This is typically done by passing credentials during the creation of the InitialContext before looking up the EJB Home interface. Specifics vary from container to container.
We tried setting the credentials and principles.
It works fine with the first worker.But for the second time invokation i am getting the same /UNAUTHENTICATED exception.
We also found the bug for the same in quartz http://jira.opensymphony.com/browse/QUARTZ-777
If we try the work around given in the bug report of setting
org.quartz.threadPool.threadCount to 1
org.quartz.simpl.SimpleThreadPool.
It works,but we dont want to use SimpleThreadPool we have configured our own Workmanager as follows