davidnez (3) [Avatar] Offline
#1
I'm migrating an application from ejb to ejb3.
I'm using Swing, Hibernate, EJB3, JNDI and JBOSS-5.0.0.Beta4.
When I load a client done with Swing, the application loads by jndi the ejb's correctly.

contextService = (ContextService) context.lookup("gn_j2ee_application/ContextServiceBean/remote");

But when I call any method on the swing client from de ejb, it fails.

The method that is calling is getEnvironment, and the motive of the error feels something like Caused by: java.io.NotSerializableException: org.jboss.security.auth.callback.SecurityAssociationHandler. But I don't know why and what I have to modify.

Does anyone could help me?

The error that return is:

java.lang.reflect.UndeclaredThrowableException
at $Proxy1.getEnvironment(Unknown Source)
at com.quavantis.gui.secenet.ApplicationMain.showLogin(ApplicationMain.java:44smilie
at com.quavantis.gui.secenet.ApplicationMain.main(ApplicationMain.java:419)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
java.io.NotSerializableException: org.jboss.security.auth.callback.SecurityAssociationHandler
at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:122)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:669)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1634)
at org.jboss.remoting.Client.invoke(Client.java:54smilie
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:10smilie
... 12 more
Caused by: java.io.NotSerializableException: org.jboss.security.auth.callback.SecurityAssociationHandler
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.jboss.aop.util.MarshalledValue.<init>(MarshalledValue.java:73)
at org.jboss.aop.metadata.SimpleMetaData.writeExternal(SimpleMetaData.java:322)
at java.io.ObjectOutputStream.writeExternalData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.jboss.aop.joinpoint.MethodInvocation.writeExternal(MethodInvocation.java:356)
at java.io.ObjectOutputStream.writeExternalData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObjectVersion2_2(JavaSerializationManager.java:120)
at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:95)
at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:120)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedWrite(MicroSocketClientInvoker.java:943)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:586)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1634)
at org.jboss.remoting.Client.invoke(Client.java:54smilie
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:10smilie
at $Proxy1.getEnvironment(Unknown Source)
davidnez (3) [Avatar] Offline
#2
Re: EJB3 Error: java.rmi.MarshalException: Failed to communicate
When I throw the swing client from eclipse IDE it runs correctly, but when I throw the application from a jsp with the next call it fails:

<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-esa -Xnoclassgc -client" initial-heap-size="256m" max-heap-size="512m"/>

<property name="SERVICE_BASE_ENDPOINT" value="jnp://<%= request.getServerName() %>:1099"/>
<property name="http.keepAlive" value="true"/>

<jar href="quavantis_geonet_secenet2006.jar" main="true" download="eager"/>
<jar href="quavantis_geonet_secenet2006clt.jar" download="eager"/>
<jar href="quavantis_geonet_j2ee_commons.jar" download="eager"/>
<jar href="quavantis_geonet_j2ee_client.jar" download="eager"/>
<jar href="quavantis_geonet_j2ee_mapping.jar" download="eager"/>
<jar href="quavantis_geonet_j2ee_reporting.jar" download="eager"/>
</resources>
<application-desc main-class="com.quavantis.gui.secenet.ApplicationMain"/>
reza_rahman (456) [Avatar] Offline
#3
Re: EJB3 Error: java.rmi.MarshalException: Failed to communicate
David:

Kindly take this to the JBoss forums...these look like JBoss configuration issues...also, JBoss 5 is pretty unstable, I would consider using JBoss 4.2...

Thanks,
Reza
davidnez (3) [Avatar] Offline
#4
Re: EJB3 Error: java.rmi.MarshalException: Failed to communicate
Now it's working correcty.

I change the version of server to use, from jboss 5.0.0.Beta4 to jboss 4.2.2.GA. It feel that was a motify of configuration of the jboss.

Thanks
reza_rahman (456) [Avatar] Offline
#5
Re: EJB3 Error: java.rmi.MarshalException: Failed to communicate
David:

Glad it worked out.

Cheers,
Reza
565395 (2) [Avatar] Offline
#6
Thanks for the code. I am going to give a try (have not had time to test it in my application yet).
??????????????