3 Replies Latest reply on Jul 14, 2004 8:12 AM by karthik_morph

    Unable to access remote entity bean. plz suggest

    karthik_morph

      hello,
      I am not able to access an entity bean diployed at remote machine thru session bean. if both are diployed in same container everything is working fine. I am using JBoss 3.2
      here is the full stack trace. plz suggest

      thanx,
      karthik

      12:09:20,806 ERROR [STDERR] java.rmi.MarshalException: error marshalling argumen
      ts; nested exception is:
      java.io.NotSerializableException: org.jboss.tm.TransactionImpl
      12:09:20,806 ERROR [STDERR] java.io.NotSerializableException: org.jboss.tm.Trans
      actionImpl
      12:09:20,806 ERROR [STDERR] at java.io.ObjectOutputStream.outputObject(Objec
      tOutputStream.java:1148)
      12:09:20,806 ERROR [STDERR] at java.io.ObjectOutputStream.writeObject(Object
      OutputStream.java:366)
      12:09:20,806 ERROR [STDERR] at org.jboss.invocation.MarshalledInvocation.wri
      teExternal(MarshalledInvocation.java:381)
      12:09:20,806 ERROR [STDERR] at java.io.ObjectOutputStream.outputObject(Objec
      tOutputStream.java:1172)
      12:09:20,822 ERROR [STDERR] at java.io.ObjectOutputStream.writeObject(Object
      OutputStream.java:366)
      12:09:20,822 ERROR [STDERR] at sun.rmi.server.UnicastRef.marshalValue(Unicas
      tRef.java:268)
      12:09:20,822 ERROR [STDERR] at sun.rmi.server.UnicastRef.invoke(UnicastRef.j
      ava:106)
      12:09:20,822 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker_
      Stub.invoke(Unknown Source)
      12:09:20,822 ERROR [STDERR] at org.jboss.invocation.jrmp.interfaces.JRMPInvo
      kerProxy.invoke(JRMPInvokerProxy.java:135)
      12:09:20,822 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invok
      e(InvokerInterceptor.java:87)
      12:09:20,822 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke
      (TransactionInterceptor.java:46)
      12:09:20,822 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(Se
      curityInterceptor.java:45)
      12:09:20,822 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(Ho
      meInterceptor.java:173)
      12:09:20,822 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(Client
      Container.java:85)
      12:09:20,822 ERROR [STDERR] at $Proxy45.findByPrimaryKey(Unknown Source)
      12:09:20,822 ERROR [STDERR] at com.sejb.TestSessionBean.getName(TestSessionB
      ean.java:102)
      12:09:20,822 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
      )
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$Conta
      inerInterceptor.invoke(StatelessSessionContainer.java:629)
      12:09:20,822 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
      nnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanc
      eInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
      nvokeNext(AbstractTxInterceptor.java:84)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
      hTransactions(TxInterceptorCMT.java:296)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
      (TxInterceptorCMT.java:104)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
      oke(SecurityInterceptor.java:117)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(L
      ogInterceptor.java:191)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
      ceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.inter
      nalInvoke(StatelessSessionContainer.java:322)
      12:09:20,822 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
      :674)
      12:09:20,822 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
      )
      12:09:20,822 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
      her.invoke(ReflectedMBeanDispatcher.java:284)
      12:09:20,822 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
      eanServerImpl.java:549)
      12:09:20,822 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.
      invoke(JRMPInvoker.java:359)
      12:09:20,822 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
      )
      12:09:20,822 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(Unic
      astServerRef.java:241)
      12:09:20,822 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.j
      ava:152)
      12:09:20,837 ERROR [STDERR] at java.security.AccessController.doPrivileged(N
      ative Method)
      12:09:20,837 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Trans
      port.java:148)
      12:09:20,837 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMess
      ages(TCPTransport.java:465)
      12:09:20,837 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$Connection
      Handler.run(TCPTransport.java:706)
      12:09:20,837 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

        • 1. Re: Unable to access remote entity bean. plz suggest
          stscit04

          Please post the method of the session bean that
          retrieves the entity bean data and returns it to
          the client.

          Stefan

          • 2. Re: Unable to access remote entity bean. plz suggest
            stscit04

            If I understand your setup correctly, you are
            using the enity-beans remote interface, this
            is usually not a good application design. Instead,
            you should use a session bean in the same container as
            a facade to the enity bean.

            This is just a general suggestion, witout any
            cde I am not shure if I understand your setup
            correctly. Please post the code I asked for in the
            previous posting.

            Stefan

            • 3. Re: Unable to access remote entity bean. plz suggest
              karthik_morph

              hello stefan,

              sorry for the delay.
              thanx for all ur comments.
              i am working on a project where we are deploying both in same container but i tried to deploy on different ones, ( even though its not really needed for)


              here is the peace of code that access entity..

              Properties prop = new Properties();
              prop.put( "java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory" );
              prop.put( "java.naming.provider.url","ipAddress:port" );
              prop.put( "java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces" );

              try {
              Context jndiContext = new InitialContext( prop );

              Object ref = jndiContext.lookup("TestEJBBean");
              testHome = (TestEJBHome)
              PortableRemoteObject.narrow(ref, TestEJBHome.class);

              }catch(Exception ex){
              ex.printStackTrace();
              }

              with the above code i have to get home interface of the entity,

              if so, now i should be able to call any finders/ create / remove..

              but i am getting the exception thrown by the container in which i have deployed my session bean.


              karthik