1 Reply Latest reply on Oct 17, 2007 5:18 PM by Peter Johnson

    javax.naming .NameNotFoundException

    Micha Roon Newbie

      I have deployed an EJB in an EAR and I know JBoss has accepted it as I can see it in the JMX console:
      +- ejb3-tutorialEAR (class: org.jnp.interfaces.NamingContext)
      | +- TravelAgentBean (class: org.jnp.interfaces.NamingContext)
      | | +- remote (proxy: $Proxy71 implements interface com.titan.travelagent.TravelAgentRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)

      I wrote a small client to try this out and get a javax.naming.NameNotFoundException: TravelAgentBean not bound

      here is the code for the client:

      public static void main(String [] args) {
      try {
      Properties p = new Properties( );
      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, " org.jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "jnp://localhost:1099");

      Context jndiContext = new InitialContext(p);

      Object ref = jndiContext.lookup("TravelAgentBean/remote");


      Thank you very much for your support.

      Micha Roon