Bugs item #663114, was opened at 2003-01-06 14:42 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=663114&group_id=22866
Category: JBossTX Group: v3.0 Rabbit Hole Status: Open Resolution: Postponed Priority: 5 Submitted By: Maxim (kimerinn) Assigned to: David Jencks (d_jencks) Summary: MarshallException when accessing remote bean Initial Comment: Hi! Scenario: 1) I have two session beans A and B, each of them have remote interfaces. A obtains home & remote interface of bean B and invokes method B.hello(). 2) When both beans are locating on the same machine, all works Ok. 3) When bean A is hosting on one computer and bean B on second, bean A obtains home interface of bean B and obtain <java.rmi.MarshalException: error marshalling arguments;> exception when creating remote interface of bean B. 4) When the bean B is accesed fom another computer through application client, all works Ok. Here is full stack trace: ===================================================================================================================== 13:16:12,169 ERROR [STDERR] java.rmi.MarshalException: error marshalling arguments; nested exception is: java.io.NotSerializableException: org.jboss.tm.TransactionImpl 13:16:12,169 ERROR [STDERR] java.io.NotSerializableException: org.jboss.tm.TransactionImpl 13:16:12,169 ERROR [STDERR] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148) 13:16:12,169 ERROR [STDERR] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) 13:16:12,179 ERROR [STDERR] at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:377) 13:16:12,179 ERROR [STDERR] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1172) 13:16:12,179 ERROR [STDERR] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) 13:16:12,179 ERROR [STDERR] at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:268) 13:16:12,179 ERROR [STDERR] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:106) 13:16:12,179 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) 13:16:12,179 ERROR [STDERR] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138) 13:16:12,179 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108) 13:16:12,179 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77) 13:16:12,179 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80) 13:16:12,220 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198) 13:16:12,220 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76) 13:16:12,220 ERROR [STDERR] at $Proxy25.create(Unknown Source) 13:16:12,220 ERROR [STDERR] at aside.ABean.testB(ABean.java:46) 13:16:12,220 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method) 13:16:12,220 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660) 13:16:12,220 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) 13:16:12,230 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77) 13:16:12,230 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) 13:16:12,230 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178) 13:16:12,230 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) 13:16:12,230 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) 13:16:12,230 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204) 13:16:12,240 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313) 13:16:12,240 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:712) 13:16:12,240 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) 13:16:12,240 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382) 13:16:12,240 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method) 13:16:12,240 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) 13:16:12,240 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:152) 13:16:12,240 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method) 13:16:12,240 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:148) 13:16:12,240 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465) 13:16:12,250 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706) 13:16:12,250 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484) ===================================================================================================================== I have created demo, containing builded archives and sources. Unzip the errordemo.zip and place errordemo\build\aside.jar to the JBoss deployment dir on first computer, and bside.jar - to the JBoss deployment dir on second computer. Edit the classpathes in the client2ejb.bat and ejb2ejb.bat, as it is described in it. client2ejb.bat runs the working example, when bean on remote computer is accessed through application client. ejb2ejb.bat runs the nonworking example, when bean on remote computer is accessed through another bean. I am using JBoss3.0.4 on JDK1.4.1 on Windows 2000 Professional. ---------------------------------------------------------------------- Comment By: Marko Kocic (markokocic) Date: 2003-03-13 18:00 Message: Logged In: YES user_id=586614 I encountered exactly the same problem. When invoking EJB from different machine, if i do invocation from servlet everything goes ok, but if I try to invoke EJB from another EJB it crashes. Suggested workaround is not an option cause then I'll have to rewrite whole app cause much EJBs are tightly coupled. How long will it take to fix this? Not that I'm making any pressure, but isn't it one of the key features of EJBs to allow application interoperability between different machines? ---------------------------------------------------------------------- Comment By: David Jencks (d_jencks) Date: 2003-02-09 21:11 Message: Logged In: YES user_id=60525 This should be fixed in jboss 4. You should get distributed tx sematics if you use the TrunkInvoker. Fixing this involves having the client-side tx interceptor know about the tx support of the ejb methods, and only attaching the tx if it needs to be transferred. A workaround in earlier versions (3.0, 3.2) should be to add an additional session bean layer on the "client" jboss server side with the method marked "NotSupported". Then there will be no existing transaction to attach to the invocation. I'm not going to port the solution backwards from 4.0 unless there are some significant complaints about this workaround. ---------------------------------------------------------------------- Comment By: Channing Walton (channingwalton) Date: 2003-02-09 20:37 Message: Logged In: YES user_id=32730 Hi, I believe I am suffering the same problem but it would good to have this verified. (I found a workaround was to use "bean" rather than 'container' level transactions.) I first reported in the EJB forum: http://www.jboss.org/forums/thread.jsp?forum=47&thread=28093 Details: I am using a session bean to look up another session bean on a remote JBoss server. I found that if the bean's transaction type was 'Container', a MarshallException was thrown when creating the remote session bean from its home. If I use 'Bean' transaction type there is no problem. More details: WinNT, JBoss 3.0.4 I set up an ejb-remote-ref to the remote session bean with corresponding remote ref in JBoss.xml I then used the InitialContext to look up the home with the ref and narrowed it. The home interface had one create method that took no arguments. When it was invoked, an exception was raised (below). Note that it was irrelevant as to whether I used a remote ref or created an InitialContext with appropriate properties-same exception raised. ==== java.rmi.MarshalException: error marshalling arguments; nested exception is: java.io.NotSerializableException: org.jboss.tm.TransactionImpl java.io.NotSerializableException: org.jboss.tm.TransactionImpl at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1143) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361) at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:377) at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1167) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:263) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101) at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80) at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76) at $Proxy36.create(Unknown Source) at com.db.fiplus.test.ejb.NodeBean.calculateSpread(NodeBean.java:61) ---------------------------------------------------------------------- Comment By: Scott M Stark (starksm) Date: 2003-01-12 10:34 Message: Logged In: YES user_id=175228 It is a bug in how the failure is being reported, but this example should in fact not work because the transaction attributes are such that distributed transaction semantics are required for the transaction context created by the Required attribute of the aside.ABean.testB method, and the Required attribute of the bside.BBean home create and hello methods. However, if you changed the bside.BBean method to RequiresNew which should succeed, it will still fail with the same error. We are debating how to fix this case. ---------------------------------------------------------------------- Comment By: Maxim (kimerinn) Date: 2003-01-06 14:48 Message: Logged In: YES user_id=500469 here is archive: ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=663114&group_id=22866 ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development