2 Replies Latest reply on Dec 18, 2005 8:47 AM by Lu Yufei

    Problems running a remote client.. EJBMetaDataImpl class not

    Adrian Pitulac Newbie

      Hi,

      I'm trying to test a stateless bean with a remote client.. I've changed java.naming.provider.url=10.0.0.2:1099 in jndi.properties from default value, deployed my test bean to the server (tried it on JBOSS 4.0.2 and also on 4.0.3 RC2). When i try to run the client (on a remote machine) i get:

      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.proxy.ejb.EJBMetaDataImpl]
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at client.ejbclient.main(ejbclient.java:14)
      Caused by: java.lang.ClassNotFoundException: org.jboss.proxy.ejb.EJBMetaDataImpl
       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Unknown Source)
       at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
       at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
       at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
       at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
       at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
       at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
       at java.io.ObjectInputStream.readClassDesc(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Unknown Source)
       at java.io.ObjectInputStream.readObject(Unknown Source)
       at java.rmi.MarshalledObject.get(Unknown Source)
       at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)
       ... 3 more
      


      I don't know where i can get this class... I read that this class provides the client with the enterprise Bean's meta-data information.
      I dont't know what i can do... Please give me some advice...


      Here's my code:

      client code

      package client;
      
      import java.rmi.RMISecurityManager;
      
      import javax.naming.*;
      
      import server.Echo;
      
      public class ejbclient {
       public static void main(String[] args) {
       try {
       System.setSecurityManager(new RMISecurityManager());
       InitialContext ctx = new InitialContext();
       Echo cal = (Echo) ctx.lookup(Echo.class.getName());
       System.out.println(cal.echotext());
       } catch (Exception e) {
       e.printStackTrace ();
       }
       }
       }



      server code

      package server;
      
      import javax.ejb.Stateless;
      
      import server.Echo;
      
      public @Stateless class EchoBean implements Echo {
      
       public String echotext() {
       return "testing remote EJB3";
       }
      
      }


      server interface

      package server;
      
      import javax.ejb.Remote;
      
      @Remote
      public interface Echo {
       public String echotext();
      }



      thanks in advance...

        • 2. Re: Problems running a remote client.. EJBMetaDataImpl class
          Lu Yufei Newbie

           

          "adrian_p" wrote:
          Hi,

          I'm trying to test a stateless bean with a remote client.. I've changed java.naming.provider.url=10.0.0.2:1099 in jndi.properties from default value, deployed my test bean to the server (tried it on JBOSS 4.0.2 and also on 4.0.3 RC2). When i try to run the client (on a remote machine) i get:

          javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.proxy.ejb.EJBMetaDataImpl]
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
           at javax.naming.InitialContext.lookup(Unknown Source)
           at client.ejbclient.main(ejbclient.java:14)
          Caused by: java.lang.ClassNotFoundException: org.jboss.proxy.ejb.EJBMetaDataImpl
           at java.net.URLClassLoader$1.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClassInternal(Unknown Source)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Unknown Source)
           at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
           at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
           at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
           at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
           at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
           at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
           at java.io.ObjectInputStream.readClassDesc(Unknown Source)
           at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
           at java.io.ObjectInputStream.readObject0(Unknown Source)
           at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
           at java.io.ObjectInputStream.readSerialData(Unknown Source)
           at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
           at java.io.ObjectInputStream.readObject0(Unknown Source)
           at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
           at java.io.ObjectInputStream.readSerialData(Unknown Source)
           at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
           at java.io.ObjectInputStream.readObject0(Unknown Source)
           at java.io.ObjectInputStream.readObject(Unknown Source)
           at java.rmi.MarshalledObject.get(Unknown Source)
           at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)
           ... 3 more
          


          I don't know where i can get this class... I read that this class provides the client with the enterprise Bean's meta-data information.
          I dont't know what i can do... Please give me some advice...


          Here's my code:

          client code

          package client;
          
          import java.rmi.RMISecurityManager;
          
          import javax.naming.*;
          
          import server.Echo;
          
          public class ejbclient {
           public static void main(String[] args) {
           try {
           System.setSecurityManager(new RMISecurityManager());
           InitialContext ctx = new InitialContext();
           Echo cal = (Echo) ctx.lookup(Echo.class.getName());
           System.out.println(cal.echotext());
           } catch (Exception e) {
           e.printStackTrace ();
           }
           }
           }



          server code

          package server;
          
          import javax.ejb.Stateless;
          
          import server.Echo;
          
          public @Stateless class EchoBean implements Echo {
          
           public String echotext() {
           return "testing remote EJB3";
           }
          
          }


          server interface

          package server;
          
          import javax.ejb.Remote;
          
          @Remote
          public interface Echo {
           public String echotext();
          }



          thanks in advance...