1 Reply Latest reply on Sep 16, 2004 4:15 AM by Darran Lofthouse

    Name not found Exception in JBoss: Pls Help

    js_gosain gosain Newbie

      Hi All,

      I am facing a problem usually a common one but as I am new to JBoss. I am getting a "Name not Bound Exception" while trying to lookup a Stateless Session bean from a Java Client.

      Properties env = new Properties();
      env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      env.setProperty("java.naming.provider.url", "localhost:1099");
      env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");



      // Get a naming context
      InitialContext jndiContext = new InitialContext(env);
      System.out.println("Got context");

      // Get a reference to the Interest Bean
      Object ref = jndiContext.lookup("ejb/test/Interest");
      System.out.println("Got reference");


      My ejb-jar.xml is
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>
      jBoss test application
      <display-name>Test</display-name>
      <enterprise-beans>

      <ejb-name>test/Interest</ejb-name>
      test1.InterestHome
      test1.Interest
      <ejb-class>test1.InterestBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      </ejb-jar>

      JBoss.xml is
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">


      <enterprise-beans>

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

      </enterprise-beans>



      Pls provide your valuable inputs.

      thanks
      Jitendra