5 Replies Latest reply on Aug 14, 2002 12:38 PM by Mikael Eriksson

    lookup

    Emmanuel Potvin Newbie

      When I try to lookup an entity bean that I have created, with the command : ctx.lookup("film");

      I receive the following exception :

      javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI class loader disabled)

      Why?

        • 1. Re: lookup
          Joel Vogt Master

          Assuming you are doing this lookup from a client program external to jboss make sure you have the jboss.jar on your classpath.

          • 2. Re: lookup
            Mark Bennett Newbie

            I also am experiencing the same error however when I add the jboss.jar to my path I recieve a new error stating,

            Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/system/Service
            [java] at java.lang.ClassLoader.defineClass0(Native Method)
            [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
            [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
            [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
            [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
            [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
            [java] at java.security.AccessController.doPrivileged(Native Method)
            [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
            [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
            [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322) [java] at java.lang.ClassLoader.defineClass0(Native Method)
            [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
            [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
            [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
            [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
            [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
            [java] at java.security.AccessController.doPrivileged(Native Method)
            [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
            [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
            [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322) [java] at java.lang.ClassLoader.defineClass0(Native Method)
            [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
            [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
            [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
            [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
            [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
            [java] at java.security.AccessController.doPrivileged(Native Method)
            [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
            [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
            [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322) [java] at java.lang.Class.getDeclaredFields0(Native Method)
            [java] at java.lang.Class.privateGetDeclaredFields(Class.java:1480)
            [java] at java.lang.Class.getField0(Class.java:1713)
            [java] at java.lang.Class.getDeclaredField(Class.java:1176)
            [java] at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1404)
            [java] at java.io.ObjectStreamClass.access$400(ObjectStreamClass.java:45)
            [java] at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:331)
            [java] at java.security.AccessController.doPrivileged(Native Method)
            [java] at java.io.ObjectStreamClass.(ObjectStreamClass.java:329)
            [java] at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
            [java] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:444)
            [java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
            [java] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
            [java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
            [java] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
            [java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616)
            [java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
            [java] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830)
            [java] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756)
            [java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
            [java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
            [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
            [java] at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
            [java] at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
            [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
            [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
            [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
            [java] at com.pason.pass.client.UserTest.main(Unknown Source)

            I'm sorry for the length of the stack trace. This error occurs specifically when I do a lookup on a local bean. Remote beans seem to work fine.

            Any advice would be appreciated. I am new to J2EE and am finding this very discouraging.

            • 3. Re: lookup
              Mark Bennett Newbie

              I also am experiencing the same error however when I add the jboss.jar to my path I recieve a new error stating,

              Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/system/Service
              [java] at java.lang.ClassLoader.defineClass0(Native Method)
              [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
              [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
              [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
              [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
              [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
              [java] at java.security.AccessController.doPrivileged(Native Method)
              [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
              [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
              [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322) [java] at java.lang.ClassLoader.defineClass0(Native Method)
              [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
              [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
              [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
              [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
              [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
              [java] at java.security.AccessController.doPrivileged(Native Method)
              [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
              [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
              [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322) [java] at java.lang.ClassLoader.defineClass0(Native Method)
              [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
              [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
              [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
              [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
              [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
              [java] at java.security.AccessController.doPrivileged(Native Method)
              [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
              [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
              [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322) [java] at java.lang.Class.getDeclaredFields0(Native Method)
              [java] at java.lang.Class.privateGetDeclaredFields(Class.java:1480)
              [java] at java.lang.Class.getField0(Class.java:1713)
              [java] at java.lang.Class.getDeclaredField(Class.java:1176)
              [java] at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1404)
              [java] at java.io.ObjectStreamClass.access$400(ObjectStreamClass.java:45)
              [java] at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:331)
              [java] at java.security.AccessController.doPrivileged(Native Method)
              [java] at java.io.ObjectStreamClass.(ObjectStreamClass.java:329)
              [java] at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
              [java] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:444)
              [java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
              [java] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
              [java] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
              [java] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
              [java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616)
              [java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
              [java] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830)
              [java] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756)
              [java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
              [java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
              [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
              [java] at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
              [java] at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
              [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
              [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
              [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
              [java] at com.pason.pass.client.UserTest.main(Unknown Source)

              I'm sorry for the length of the stack trace. This error occurs specifically when I do a lookup on a local bean. Remote beans seem to work fine.

              Any advice would be appreciated. I am new to J2EE and am finding this very discouraging.

              • 4. Re: lookup
                Joel Vogt Master

                That is the jboss jars, from jboss/client

                • 5. Local beans can not be called from external client
                  Mikael Eriksson Novice


                  Local beans/interfaces can only be used from within the same JVM. Since your client is an external program (at least it sounds like that) it can only use the remote interface.


                  Regards

                  > I'm sorry for the length of the stack trace. This
                  > error occurs specifically when I do a lookup on a
                  > local bean. Remote beans seem to work fine.
                  >
                  > Any advice would be appreciated. I am new to J2EE
                  > and am finding this very discouraging.