3 Replies Latest reply on Aug 29, 2002 3:06 PM by carpenoctum

    deploy remote client error: java.lang.NoSuchMethodException

    carpenoctum

      Anyone out there with some input?

      I'm running jboss 2.4.4....

      I've download, compiled, and deployed the interest example....the InterestClient runs fine....
      however....
      When attempting to deploy and run the InterestClient from another machine the java.lang.NoSuchMethodException is thrown....
      the exception occurs when attempting to use the lookup method of the InitialContext class...in the interest example this is the line which reads:
      Object ref = jndiContext.lookup("interest/Interest");

      here is the stack trace:
      java.lang.NoSuchMethodException
      at java.lang.Class.getMethod0(Native Method)
      at java.lang.Class.getMethod(Class.java:888)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.(HomeProxy.java:70)
      at java.lang.reflect.Field.getLong(Native Method)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:415)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.init(ObjectStreamClass.java:401)
      at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:112)
      at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:59)
      at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:88)
      at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:566)
      at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
      at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2262)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1411)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:353)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.jboss.docs.interest.InterestClient.main(InterestClient.java:40)
      Exception in thread "main" java.lang.ExceptionInInitializerError: java.lang.NoSuchMethodException
      at java.lang.Class.getMethod0(Native Method)
      at java.lang.Class.getMethod(Class.java:888)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.(HomeProxy.java:70)
      at java.lang.reflect.Field.getLong(Native Method)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:415)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.init(ObjectStreamClass.java:401)
      at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:112)
      at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:59)
      at java.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:88)
      at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:566)
      at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
      at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2262)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
      at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1411)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:353)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.jboss.docs.interest.InterestClient.main(InterestClient.java:40)

      Also....along these lines...I've searched and searched the forums, but have not been able to find a step by step example for deploying a remote client....i.e., jars required by the client, jre required on the remote machine, etc.....

      thanks!

      peter

        • 1. Re: deploy remote client error: java.lang.NoSuchMethodExcept
          joelvogt

          Well, the jars you will for your client are in jboss/client. Put these on your remote client's classpath.

          Now the jndi lookup will work fine so long as you have a jndi properties or initial context that points to your server machine. Ie, make sure it isn't localhost:1099 but 198.162.1.133:1099 etc

          Anymore problems just let me know

          • 2. Re: deploy remote client error: java.lang.NoSuchMethodExcept
            carpenoctum

            thanks for the reply....

            every jar file from the //jboss/client directory is on the remote machine...each jar file is on the classpath for the remote machine....

            the jndi.properties file has the appropriate setting for the server machine...I've tried using the server name and the ip address for the server....the server is running win2K, the remote machine is NT4......

            I've also tried different combinations with the client code such as:
            ---------------------------
            Properties props = System.getProperties();

            InitialContext jndiContext = new InitialContext(props);

            Object ref = jndiContext.lookup("interest/Interest");

            ---------------------------
            and
            ---------------------------
            System.setProperty ("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

            System.setProperty ("java.naming.provider.url", "myserver:1099");

            System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");

            InitialContext jndiContext = new InitialContext(System.getProperties());

            Object ref = jndiContext.lookup("interest/Interest");

            ---------------------------

            each of these works fine when run locally on the server machine...however...each throws the same error when run on a remote machine.....and always when the lookup method is called....

            any ideas?

            • 3. Re: deploy remote client error: java.lang.NoSuchMethodExcept
              carpenoctum

              all

              we found the problem.....
              sun's javax_ejb.zip file was jamming the
              process, the proper files are in jboss-j2ee.jar...

              simple solution....adjust your class paths to use
              the jboss-j2ee.jar and avoid the javax_ejb.zip
              file.....