4 Replies Latest reply on May 3, 2003 8:43 PM by daseinw

    javax.naming.NameNotFoundException: TraderEJB not bound

      Hi,

      Any help will be appreciated for the Exception I am getting.

      Seetesh

      Trader.jar
      =======
      0 Tue Apr 22 14:02:30 GMT+05:30 2003 META-INF/
      74 Tue Apr 22 14:02:30 GMT+05:30 2003 META-INF/MANIFEST.MF
      642 Wed Apr 16 15:30:46 GMT+05:30 2003 META-INF/ejb-jar.xml
      249 Wed Apr 16 15:33:12 GMT+05:30 2003 META-INF/jboss.xml
      0 Tue Apr 22 14:01:50 GMT+05:30 2003 stateless/trader/
      245 Wed Apr 16 10:41:32 GMT+05:30 2003 stateless/trader/Trader.class
      1280 Wed Apr 16 10:42:24 GMT+05:30 2003 stateless/trader/TraderBean.class
      276 Wed Apr 16 10:42:06 GMT+05:30 2003 stateless/trader/TraderHome.class

      ejb-jar.xml
      ========
      <?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 >
      <enterprise-beans>

      <ejb-name>TraderEJB</ejb-name>
      stateless.trader.TraderHome
      stateless.trader.Trader
      <ejb-class>stateless.trader.TraderBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

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

      jboss.xml
      =======

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
      "http://www.jboss.org/j2ee/dtds/jboss-web_3_0.dtd">


      <enterprise-beans>

      <ejb-name>TraderEJB</ejb-name>
      <jndi-name>TraderJNDI</jndi-name>
      true

      </enterprise-beans>


      Client.jsp
      =======
      <%@page language = "java"
      import = "java.sql.*,java.util.*,java.rmi.*,javax.ejb.*,javax.naming.*, stateless.trader.*" %>
      <%
      Hashtable props = new Hashtable();
      props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      props.put(InitialContext.PROVIDER_URL, "jnp://localhost:1099");
      InitialContext ctx = new InitialContext(props);
      // TraderHome home = (TraderHome)ctx.lookup("ejb/testcmp");
      // TraderHome home = (TraderHome)ctx.lookup("java:comp/env/ejb/TraderEJB");
      // TraderHome home = (TraderHome)ctx.lookup("TraderEJB");
      TraderHome home = (TraderHome)ctx.lookup("java:comp/env/TraderEJB");
      %>

        • 1. Re: javax.naming.NameNotFoundException: TraderEJB not bound
          raja05

          TraderHome home = (TraderHome)ctx.lookup("TraderJNDI");
          should work. Your JNDI name is
          <jndi-name>TraderJNDI</jndi-name>


          -Raj

          • 2. Re: javax.naming.NameNotFoundException: TraderEJB not bound

            Hi Raj,

            Thanks for pointout out the error. Its working fine.

            Seetesh

            • 3. Re: javax.naming.NameNotFoundException: TraderEJB not bound
              samirny

              Hi..
              I am new to JBOSS.My ejb is working fine..What is the CLASSPATH to set to run the client?
              Rightnow I am setting
              CLIENT_CLASSPATH=$(JBOSS_HOME)/client

              JBOSS_CLASSPATH=$(CLIENT_CLASSPATH)/concurrent.jar:$(CLIENT_CLASSPATH)/jboss-common-client.jar:$(CLIENT_CLASSPATH)/jboss-client.jar:$(CLIENT_C
              LASSPATH)/jboss-system-client.jar:$(CLIENT_CLASSPATH)/jboss-j2ee.jar:$(CLIENT_LASSPATH)/jbosssx-client.jar:$(CLIENT_CLASSPATH)/jnp-client.jar:
              $(CLIENT_CLASSPATH)/log4j.jar:$(CLIENT_CLASSPATH)/jsse.jar:$(CLIENT_CLASSPATH)/jcert.jar:$(CLIENT_CLASSPATH)/jnet.jar:$(CLIENT_CLASSPATH)/jmx-
              rmi-connector-client.jar:$(CLIENT_CLASSPATH)/jbossha-client.jar:$(CLIENT_CLASSPATH)/jboss-jsr77.jar:$(CLIENT_CLASSPATH)/crimson.jar:$(CLIENT_C
              LASSPATH)/jboss-jaas.jar:.


              But getting exceptions
              as Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/tm/TransactionPropagationContextFactory

              I know i don;t need to have all the above jars.

              CAN U PLEASE tell me what r the exact jars needed to run the client.

              Thanks.

              • 4. Re: javax.naming.NameNotFoundException: TraderEJB not bound
                daseinw

                Hi,
                I'm by no means a JBOSS expert, but I thought I'd share my CLASSPATH since I most recently had the same issue. You probably want to ignore everything except the JBoss jars, but I thought I'd include the path for my client in its entirety:

                C:\jdk1.3.1_07\jre\lib\i18n.jar;
                C:\jdk1.3.1_07\jre\lib\jaws.jar;
                C:\jdk1.3.1_07\jre\lib\rt.jar;
                C:\jdk1.3.1_07\jre\lib\sunrsasign.jar;
                C:\j2sdkee1.3.1\lib\j2ee.jar;
                C:\j2sdkee1.3.1\lib\ejb10deployment.jar;
                C:\j2sdkee1.3.1\lib\j2ee-ri-svc.jar;
                C:\j2sdkee1.3.1\lib\j2eetools.jar;
                C:\j2sdkee1.3.1\lib\jhall.jar;
                D:\applications\jboss-3.2.0_tomcat-4.1.24\client\jboss-client.jar;
                D:\applications\jboss-3.2.0_tomcat-4.1.24\client\jboss-common-client.jar;
                D:\applications\jboss-3.2.0_tomcat-4.1.24\client\jboss-jaas.jar;
                D:\applications\jboss-3.2.0_tomcat-4.1.24\client\jnp-client.jar;
                D:\applications\jboss-3.2.0_tomcat-4.1.24\client\jbosssx-client.jar;
                D:\applications\jboss-3.2.0_tomcat-4.1.24\client\jboss-transaction-client.jar

                Hope that helps.
                By the way, not sure if you're doing this by manually, but I'm using IntelliJ's idea to create specific JBoss libraries that I can include when necessary.

                Good luck!