3 Replies Latest reply on Sep 22, 2006 11:11 AM by Wolfgang Knauf

    NameNotFoundException

    jay anandan Newbie

      i used ejb3.0 in jboss4.0.4.While look up for remote bean it throws NameNotFoundException

      i used lookup code:-
      Stock stock = (Stock) initialContext.lookup("StockBean/remote");

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=jnp://192.168.0.91:1099

      i included all the jars in the path.
      But it still throws StockBean not found.NameNotFoundException
      This code works in jboss 4.0.3spi,but not in jboss4.0.4
      Please help me.

        • 1. Re: NameNotFoundException
          Anders Hedstrom Novice

          You don't say how you deploy your app, but if it is deployed in an ear, you need to add the name of the ear to the jndi name:

          <ear-name>/StockBean/remote

          • 2. Re: NameNotFoundException
            jay anandan Newbie

            yes i tried .

            that is my look up code is.....
            initialContext.lookup("EARNAME/StockBean/remote");

            but now it throws some other problem


            javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)]
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at com.ncit.his.inventory.ejb.stock.test.TestClient.main(TestClient.java:40)
            Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)
            at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:531)
            at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
            at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
            at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
            at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
            at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
            at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
            ... 3 more


            Please help me to rectify this problem
            Thanks in advance

            • 3. Re: NameNotFoundException
              Wolfgang Knauf Master

              Hi !

              Seems you need to add more jars to your classpath, at least "JBOSS_HOME\server\default\deploy\ejb3.deployer\jboss-ejb3.jar".

              For my own simple app client I needed those jars:
              JBOSS_HOME\server\default\deploy\ejb3.deployer\jboss-ejb3.jar
              JBOSS_HOME\server\default\deploy\ejb3.deployer\jboss-ejb3x.jar
              JBOSS_HOME\server\default\deploy\jboss-aop-jdk50.deployer\jboss-aop-jdk50.jar
              JBOSS_HOME\server\default\deploy\jboss-aop-jdk50.deployer\jboss-aspect-library-jdk50.jar

              There are some changes beetween 4.0.4/RC8 and RC9, but I think this should do it.