On Thu, May 10, 2001 at 03:58:23PM +0200, Martin Renner wrote:
> Hi.
> 
> As far as I know, every instance variable of an EJB has to be serializable or marked 
> as transient (because the EJB by itself is implementing java.io.Serializable).

The relevent section of the spec (version 2.0pd2) is 6.4.1.

> I just realized, that org.jboss.ejb.EnterpriseContext contains an inner class 
> EJBContextImpl which is implementing javax.ejb.EJBContext. This inner class, 
>however, 
> is neither serializable nor externalizable.
> 
> In one of my entity beans I hold a reference (which is passed by setEntityContext) 
>to 
> the EJBContext. When I use this entity bean, I get the following exception (in my 
> client):
> 
> java.lang.reflect.UndeclaredThrowableException: java.io.NotSerializableException: 
> org.jboss.ejb.EntityEnterpriseContext$EntityContextImpl
>    at 
> 
>sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
>    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
>    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
>    at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown 
> Source)
>    at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:248)
>    at $Proxy6.getDocumentsByDocumentStructure(Unknown Source)
> .....
> 
> 
> IMHO EJBContextImpl should be serializable so that I can hold a reference to it, or 
> am I wrong?

You should be able to hold a reference to it, even though it is not
serialisable.  Please provide some more information, such as the code for
your entity bean and how the client is calling it.

Toby.

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to