0 Replies Latest reply on Jul 4, 2002 6:13 AM by Robert Jasny

    JBoss-3.0: Passivation problem SFSB with reference to other

    Robert Jasny Newbie

      Hello,

      I searched the forum but I couldn't find a similar constellation for my problem. My example is derived from an application which works in JBoss-2.4.4 but no more in JBoss-3.0.

      I have a SFSB "AEJB" which holds a reference to another SFSB "BEJB". When the ejbCreate method of "AEJB" is called, a JNDI lookup for "BHome" is done, then I create the remote reference to "BEJB" and store it in a public member variable of "AEJB".
      This works fine until the container starts passivation.
      When the container first passivates "BEJB" and then tries to passivate "AEJB" an error occurs (see also error message below):
      "java.rmi.ServerException: Could not passivate; nested exception is: java.rmi.MarshalException: Invalid remote object"

      Sure, when I set the public member variable to transient the error does not happen again. I can also set the public variable to null in ejbPassivate and repopulate it again in ejbActivate - but for this I have to change the design of my application which works fine in JBoss-2.4.4.

      As much I read in the EJB2.0 spec (7.4.1) the container should be able to handle the passivation of remote references by itself, so maybe this is a bug in JBoss-3.0?


      2002-07-04 10:08:29,015 INFO [org.jboss.deployment.MainDeployer] Successfully completed deployment of package: file:/D:/Programme/jboss-3.0.0/server/default/deploy/Test.jar
      2002-07-04 10:08:42,905 INFO [STDOUT] AEJB: Constructor AEJB() called
      2002-07-04 10:08:42,905 INFO [STDOUT] AEJB: setSessionContext(SessionContext sc) called
      2002-07-04 10:08:42,915 INFO [STDOUT] AEJB: ejbCreate(String _user) called with robbi
      2002-07-04 10:08:42,915 INFO [STDOUT] AEJB: ejbCreate: create B with user robbi
      2002-07-04 10:08:42,925 INFO [STDOUT] BEJB: Constructor BEJB() called
      2002-07-04 10:08:42,925 INFO [STDOUT] BEJB: setSessionContext(SessionContext sc) called
      2002-07-04 10:08:42,925 INFO [STDOUT] BEJB: ejbCreate(String _user) called with robbi
      2002-07-04 10:08:42,935 INFO [STDOUT] AEJB: ejbCreate: B created
      2002-07-04 10:08:42,985 INFO [STDOUT] AEJB: getUserFromB() called
      2002-07-04 10:08:42,995 INFO [STDOUT] BEJB: getUser() called
      2002-07-04 10:09:15,071 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Scheduling for passivation overaged bean B with id = 1025768961311 - Cache size = 1
      2002-07-04 10:09:15,071 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Aging out from cache bean Bwith id = 1025768961311; cache size = 1
      2002-07-04 10:09:15,071 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Attempting to passivate; ctx=org.jboss.ejb.StatefulSessionEnterpriseContext@b1fea4
      2002-07-04 10:09:15,071 INFO [STDOUT] BEJB: ejbPassivate() called
      2002-07-04 10:09:21,510 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Scheduling for passivation overaged bean A with id = 1025768961310 - Cache size = 1
      2002-07-04 10:09:21,510 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Aging out from cache bean Awith id = 1025768961310; cache size = 1
      2002-07-04 10:09:21,510 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Attempting to passivate; ctx=org.jboss.ejb.StatefulSessionEnterpriseContext@4e5056
      2002-07-04 10:09:21,510 INFO [STDOUT] AEJB: ejbPassivate() called
      2002-07-04 10:09:21,540 ERROR [org.jboss.logging.Log4jService$ThrowableListenerLoggingAdapter] unhandled throwable
      java.rmi.ServerException: Could not passivate; nested exception is:
      java.rmi.MarshalException: Invalid remote object
      at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:294)
      at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:78)
      at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:615)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: java.rmi.MarshalException: Invalid remote object
      at java.rmi.server.RemoteObject.writeObject(RemoteObject.java:332)
      at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:780)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1294)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.writeExternal(JRMPInvokerProxy.java:149)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1265)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1243)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1330)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1302)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1330)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1302)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:288)
      ... 4 more