1 Reply Latest reply on Jul 26, 2007 10:00 PM by wayne baylor

    PROJECTNAME/FooBean/remote JNDI naming?

    Ákos Maróy Newbie

      I'm having the following issue. An application written for JBoss tries to refer to its beans when locating them through JNDI using the following pattern:

      ctx = new InitialContext(System.getProperties());
      ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      ctx.addToEnvironment("java.naming.provider.url", "localhost:1099");
      FooBean = (FooBean) ctx.lookup("PROJECTNAME/FooBean/remote");
      


      and the bean is not found. if I reset the last call to:

      FooBean = (FooBean) ctx.lookup("FooBean/remote");
      


      it finds it without problems.

      on startup, JBoss initializes all beans automagically according to the log:

      14:10:13,159 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      14:10:13,168 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=PROJECTNAME.jar,name=FooBean,service=EJB3 with dependencies:
      14:10:13,342 INFO [EJBContainer] STARTED EJB: com.foo.bar.FooBean ejbName: FooBean
      


      how can I make the code work as in the original setup, i.e. make the JDNI refer to these objects by the name "PROJECTNAME/FooBean/remote"?