1 Reply Latest reply on Nov 8, 2001 1:50 PM by Jorge

    InterestEJB not bound

    Jorge Newbie

      Well, I've a problem I'm trying to run the interest sample but the server answer me with "InterestEJB not bound"

      the code:

      (Client)

      public void init() {
      try {
      // Set up the naming provider. This may not always be necessary,
      // depending on how your Java system is configured.
      System.setProperty("java.naming.factory.initial",
      "org.jnp.interfaces.NamingContextFactory");
      System.setProperty("java.naming.provider.url",
      "localhost:1099");
      // Get a naming context
      InitialContext jndiContext = new InitialContext();

      // Get a reference to the Interest Bean
      Object ref = jndiContext.lookup("java:/InterestEJB");

      // Get a reference from this to the Bean's Home interface
      InterestHome home = (InterestHome)
      PortableRemoteObject.narrow (ref, InterestHome.class);

      // Create an Interest object from the Home interface
      m_resource = home.create();
      } catch(Exception e) {
      System.out.println("Excepción: " + e );
      }
      }

      (Descriptor)

      <?xml version="1.0" encoding="UTF-8"?>

      <enterprise-beans>

      <ejb-name>Interest</ejb-name>
      <jndi-name>InterestEJB</jndi-name>

      </enterprise-beans>


      some people could help me ??

      Thanks a lot.

        • 1. Re: InterestEJB not bound
          Jorge Newbie

          well I'd change the code and add this some lines but the problem is the same
          some help??


          try {
          // Set up the naming provider. This may not always be necessary,
          // depending on how your Java system is configured.
          System.setProperty("java.naming.factory.initial",
          "org.jnp.interfaces.NamingContextFactory");
          System.setProperty("java.naming.provider.url",
          "localhost:1099");
          // Get a naming context
          Hashtable env = new Hashtable();
          env.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          env.put(InitialContext.PROVIDER_URL, "localhost:1099");
          env.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming");

          InitialContext jndiContext = new InitialContext(env);

          // Get a reference to the Interest Bean
          Object ref = jndiContext.lookup("java:/InterestEJB");

          // Get a reference from this to the Bean's Home interface
          InterestHome home = (InterestHome)
          PortableRemoteObject.narrow (ref, InterestHome.class);

          // Create an Interest object from the Home interface
          m_resource = home.create();
          } catch(Exception e) {
          System.out.println("Excepción: " + e );
          }
          }

          I dont hunderstand why for but no one ejb run the problem is always the same "not bound"