Bugs item #558362, was opened at 2002-05-20 17:37
Message generated for change (Settings changed) made by ejort
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=558362&group_id=22866

Category: JBossServer
Group: v2.4 (stable)
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: Chris Harris (charris)
Assigned to: Nobody/Anonymous (nobody)
Summary: sfsb loses security on passivate

Initial Comment:
(new bug as requested by Scott)

JBoss 2.4.5/Jetty 4, Win2K, Sun JDK1.3.1_03

When a stateful bean gets passivated by the passivator 
background thread, there is no principal and 
credential associated (through SecurityAssociation) so 
any activity inside ejbPassivate that requires 
security (like, accessing another bean in a secured 
server) will throw a SecurityException. Further 
investigation shows that, inside ejbPassivate(), 
sessionContext.getCallerPrincipal() returns the 
correct principal but SecurityAssociation.getPrincipal
() is null.

Stack trace is as follows:

[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.checkSecurity
Association(SecurityInte rceptor.java:167)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:116)
at 
org.jboss.ejb.plugins.StatefulSessionInstanceIntercepto
r.invoke(StatefulSession InstanceInterceptor.java:255)
at 
com.lombardrisk.jbossinfra.audit.AuditTrailInterceptor.
invoke(AuditTrailInterce ptor.java:175)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext
(TxInterceptorCMT.java:138)
at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.jav a: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(JRMPContainerInvo ker.java:506)
at 
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invo
keContainer(GenericProxy .java:335)
at 
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionPr
oxy.invoke(StatefulSessi onProxy.java:136)
at $Proxy230.remove(Unknown Source)
at 
com.lombardrisk.scratch.ScratchStatefulReferringBean.ej
bPassivate(ScratchStatef ulReferringBean.java:73)
at 
com.lombardrisk.scratch.ScratchStatefulReferringSession
.ejbPassivate(ScratchSta tefulReferringSession.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at 
org.jboss.ejb.plugins.StatefulSessionFilePersistenceMan
ager.passivateSession(St 
atefulSessionFilePersistenceManager.jav
:278)
at 
org.jboss.ejb.plugins.StatefulSessionInstanceCache.pass
ivate(StatefulSessionIns tanceCache.java:79)
at 
org.jboss.ejb.plugins.AbstractInstanceCache$1.execute
(AbstractInstanceCache.jav a: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.checkSecurity
Association(SecurityInte rceptor.java:167)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:116)
at 
org.jboss.ejb.plugins.StatefulSessionInstanceIntercepto
r.invoke(StatefulSession InstanceInterceptor.java:255)
at 
com.lombardrisk.jbossinfra.audit.AuditTrailInterceptor.
invoke(AuditTrailInterce ptor.java:175)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext
(TxInterceptorCMT.java:138)
at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.jav a: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(JRMPContainerInvo ker.java:506)
at 
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invo
keContainer(GenericProxy .java:335)
at 
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionPr
oxy.invoke(StatefulSessi onProxy.java:136)
at $Proxy230.remove(Unknown Source)
at 
com.lombardrisk.scratch.ScratchStatefulReferringBean.ej
bPassivate(ScratchStatef ulReferringBean.java:73)
at 
com.lombardrisk.scratch.ScratchStatefulReferringSession
.ejbPassivate(ScratchSta tefulReferringSession.java:34)
at java.lang.reflect.Method.invoke(Native Method)
at 
org.jboss.ejb.plugins.StatefulSessionFilePersistenceMan
ager.passivateSession(St 
atefulSessionFilePersistenceManager.jav
:278)
at 
org.jboss.ejb.plugins.StatefulSessionInstanceCache.pass
ivate(StatefulSessionIns tanceCache.java:79)
at 
org.jboss.ejb.plugins.AbstractInstanceCache$1.execute
(AbstractInstanceCache.jav a:622)
at org.jboss.util.WorkerQueue$QueueLoop.run
(WorkerQueue.java:206)
at java.lang.Thread.run(Thread.java:479)


(with some logging inside the ejbXXX methods of the 
bean)

Test case is attached - one stateful bean with a 
reference to another, removes the referred-bean inside 
ejbPassivate(). Need to set up JBoss with a container-
configuration that passivates the bean quickly. Jar 
includes compiled beans, dd's and source. Can deploy 
straight to JBoss if you have a container-conf 
called 'Long Lived Stateful SessionBean'



----------------------------------------------------------------------

Comment By: Sacha Labourey (slaboure)
Date: 2003-04-19 16:24

Message:
Logged In: YES 
user_id=95900

Does the spec requires that ejbPassivate be called with an 
appropriate security context? I though that client initiated 
invocations had, but not container self-initiated invocations.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=558362&group_id=22866


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to