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).

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?


Martin


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

Reply via email to