1 Reply Latest reply on Feb 3, 2003 2:13 PM by Micha³ Kochanowicz

    Why can't call EJB on other server?

    Micha³ Kochanowicz Newbie

      Hi

      Very simple code:
      -------------------------------------------
      Properties properties = (Properties)System.getProperties().clone();
      properties.setProperty(Context.PROVIDER_URL, providerUrl);
      InitialContext initialContext = new InitialContext(properties);

      JBossTestSession jBossTestSession = ((JBossTestSessionHome)initialContext.lookup(JBossTestSessionHome.JNDI_NAME)).create();
      -------------------------------------------
      In short: create instance of bean on other server. It works if executed from servlet, but doesn't when executed from stateless session bean called from that servlet. The result is:
      18:57:47,694 ERROR [JBossTestSession]
      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 java.util.HashMap.writeObject(HashMap.java:807)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1859)
      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1205)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
      at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:324)
      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:128)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy63.create(Unknown Source)

      Is that my mistake, or bug in JBoss? TIA for any help.

      regards Michau