I'm using 2.4.5/jetty4 final release (dated 2002-05-10) and I'm still getting this
problem. I get it on sfsb passivation, however.
Testcase can be supplied on demand (the forums don't want to upload the attachment,
and since the bug is closed sf won't accept attachments): 2 stateful beans, one bean
holds a reference to the other. When the first bean is passivated, the passivation
thread has no security association (i.e. SecurityAssociation.getPrincipal() returns
null) therefore the ejbPassivate() method - which attempts to remove its reference to
the other EJB - fails because the remove() requires authenticating.
I added some logging to ejbPassivate() and found that while
sessionContext.getCallerPrincipal() returned the correct principal,
SecurityAssociation.getPrincipal() returned null. This seems to me to be purely
because the principal and credentials are associated with the thread, and the
passivator background thread is obviously unauthenticated.
I'm using the apparently-fixed version of StatefulSessionInstanceInterceptor (cvs ver
1.15.6.6, the one in the release) but no joy.
Stack trace is:
[ScratchStatefulReferringBean] Creating bean:
com.lombardrisk.scratch.ScratchStatefulReferringSession
[ScratchStatefulReferredBean] Creating bean:
com.lombardrisk.scratch.ScratchStatefulReferredSession
[ScratchStatefulReferredBean] Passivating bean:
com.lombardrisk.scratch.ScratchStatefulReferredSession
[ScratchStatefulReferredBean] getCallerPrincipal is guest
[ScratchStatefulReferredBean] SecurityAssociation.getPrincipal()=null
[ScratchStatefulReferringBean] Passivating bean:
com.lombardrisk.scratch.ScratchStatefulReferringSession
[ScratchStatefulReferringBean] getCallerPrincipal is guest
[ScratchStatefulReferringBean] SecurityAssociation.getPrincipal()=null
[ScratchStatefulReferredBean] Activating bean:
com.lombardrisk.scratch.ScratchStatefulReferredSession
[SecurityInterceptor] Authentication exception, principal=null
[ScratchStatefulReferred] TRANSACTION ROLLBACK EXCEPTION:
javax.transaction.TransactionRolledbackException: checkSecurityAssociation; nested
exception is:
java.lang.SecurityException: Authentication exception, principal=null; nested
exception is:
java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
java.lang.SecurityException: Authentication exception, principal=null
java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
java.lang.SecurityException: Authentication exception, principal=null
java.lang.SecurityException: Authentication exception, principal=null
at
org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:167)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:116)
at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:255)
at
com.lombardrisk.jbossinfra.audit.AuditTrailInterceptor.invoke(AuditTrailInterceptor.java:175)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
at
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:347)
at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:506)
at
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
at
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSessionProxy.java:136)
at $Proxy230.remove(Unknown Source)
at
com.lombardrisk.scratch.ScratchStatefulReferringBean.ejbPassivate(ScratchStatefulReferringBean.java:73)
at
com.lombardrisk.scratch.ScratchStatefulReferringSession.ejbPassivate(ScratchStatefulReferringSession.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.jav
:278)
at
org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:79)
at
org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:622)
at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
at java.lang.Thread.run(Thread.java:479)
[ScratchStatefulReferringBean] Couldn't remove
javax.transaction.TransactionRolledbackException: checkSecurityAssociation; nested
exception is:
java.lang.SecurityException: Authentication exception, principal=null; nested
exception is:
java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
java.lang.SecurityException: Authentication exception, principal=null
java.rmi.RemoteException: checkSecurityAssociation; nested exception is:
java.lang.SecurityException: Authentication exception, principal=null
java.lang.SecurityException: Authentication exception, principal=null
at
org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:167)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:116)
at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:255)
at
com.lombardrisk.jbossinfra.audit.AuditTrailInterceptor.invoke(AuditTrailInterceptor.java:175)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
at
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:347)
at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:506)
at
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
at
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSessionProxy.java:136)
at $Proxy230.remove(Unknown Source)
at
com.lombardrisk.scratch.ScratchStatefulReferringBean.ejbPassivate(ScratchStatefulReferringBean.java:73)
at
com.lombardrisk.scratch.ScratchStatefulReferringSession.ejbPassivate(ScratchStatefulReferringSession.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.jav
:278)
at
org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:79)
at
org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:622)
at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
at java.lang.Thread.run(Thread.java:479)
(There is logging output in ejbCreate, ejbRemove, ejbActivate, ejbPassivate)
The test case is in com.lombardrisk.scratch.StatefulSessionPassivationSecurityTest, it
assumes you have a container config called (ironically) 'Long Lived Stateful
SessionBean' and that it is set up so that a bean will passivate in less than 20
seconds.
I'm hoping I'm being an idiot and doing something wrong, 'cos this is killing us right
now.
* * *
View thread online: http://jboss.org/forums/thread.jsp?forum=66&thread=14829
_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development