Re: EJB Passivation with Weblogic

Allwin Immanuel <[email protected]> Mon, 24 Mar 2003 21:51:55 -0500
Newsgroups gmane.comp.java.sun.connector
Message-ID <CB8215AD270F3F4B82E6B04F567C0AC40115ABCD@eipmailsvr.erunway.atc.dns>
Madhav,

The reason for the error is:
javax.resource.cci.Connection is not serializable (Serializability of a
class is enabled by the class implementing the java.io.Serializable
interface. Classes that do not implement this interface will not have any of
their state serialized or deserialized.).

Solution:
Assign the instance's fields storing the connections to null.

Below text is taken from the ejb spec :

Instance passivation and conversational state
The Bean Provider is required to ensure that the ejbPassivate method leaves
the instance fields

ready to be serialized by the Container. The objects that are assigned to
the instance's non-transient

fields after the ejbPassivate method completes must be one of the following:

 A serializable object .
 A null.
 An enterprise bean's remote interface reference, even if the stub class is
not serializable.
 An enterprise bean's remote home interface reference, even if the stub
class is not serializable.
 ........

This means, for example, that the Bean Provider must close all JDBC
connections in ejbPassi-vate
and assign the instance's fields storing the connections to null.

Thanks,
Allwin

-----Original Message-----
From: Madhav Inamti [mailto:[email protected]]
Sent: Monday, March 24, 2003 11:20 PM
To: [email protected]
Subject: EJB Passivation with Weblogic



When I have a stateful bean being passivated with Weblogic,  I get an error



<Error> <EJB> <010024> <Error during passivation:

java.io.NotSerializableException:
weblogic.connector.common.internal.ConnectionWrapper



I have the javax.resource.cci.Connection as an EJB instance variable.



Would appreciate some comments on this from folks who have been able to
passivate and activate stateful EJB using Weblogic.



Thanks in advance,



Madhav