1 Reply Latest reply on May 16, 2003 2:06 AM by R. W. Stavros

    javax.naming.NameNotFoundException: WeatherDetailsEjb not bo

    R. W. Stavros Newbie

      I get the following error whenever I try and run my sample program:

      javax.naming.NameNotFoundException: WeatherDetailsEjb not bound

      Here's the code:


      import java.util.Hashtable;
      import javax.naming.Context;
      import javax.naming.InitialContext;
      import javax.rmi.PortableRemoteObject;
      import spawar.navy.mil.rapids.ejb.WeatherDetailsEjb;
      import spawar.navy.mil.rapids.ejb.WeatherDetailsEjbHome;
      import java.util.Collection;
      import java.util.Iterator;
      import javax.naming.NamingException;

      public class WeatherDetailsEjbClient
      { public static void main(String [] args)
      { WeatherDetailsEjbClient weatherDetailsEjbClient = new WeatherDetailsEjbClient2();
      try
      { Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "localhost");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
      Context context = new new InitialContext(env);;
      WeatherDetailsEjbHome weatherDetailsEjbHome
      = (WeatherDetailsEjbHome) PortableRemoteObject.narrow
      ( context.lookup ( "WeatherDetailsEjb" ),
      WeatherDetailsEjbHome.class
      );
      WeatherDetailsEjb weatherDetailsEjb;
      } // End try
      catch( Throwable exception )
      { exception .printStackTrace();
      } // End catch Throwable
      } // End main
      } // End WeatherDetailsEjbClient


      Here's the jboss.xml


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

      <enterprise-beans>

      <ejb-name>WeatherDetailsEjb</ejb-name>
      <jndi-name>WeatherDetailsEjb</jndi-name>

      </enterprise-beans>


      I can make a jar and ear files and they deploy without exception.

      23:42:24,670 INFO [MainDeployer] Starting deployment of package: file:/C:/OpenSource/JBoss/jboss-3.0.4_tomcat-4.1.12/server/RapidsServer/deploy/user-service.xml
      23:42:24,780 INFO [MainDeployer] Deployed package: file:/C:/OpenSource/JBoss/jboss-3.0.4_tomcat-4.1.12/server/RapidsServer/deploy/user-service.xml
      23:42:24,780 INFO [MainDeployer] Starting deployment of package: file:/C:/OpenSource/JBoss/jboss-3.0.4_tomcat-4.1.12/server/RapidsServer/deploy/RapidsEjb.jar
      23:42:24,800 INFO [MainDeployer] Deployed package: file:/C:/OpenSource/JBoss/jboss-3.0.4_tomcat-4.1.12/server/RapidsServer/deploy/RapidsEjb.jar
      23:42:24,810 INFO [MainDeployer] Starting deployment of package: file:/C:/OpenSource/JBoss/jboss-3.0.4_tomcat-4.1.12/server/RapidsServer/deploy/RapidsEjb.ear
      23:42:24,971 INFO [MainDeployer] Deployed package: file:/C:/OpenSource/JBoss/jboss-3.0.4_tomcat-4.1.12/server/RapidsServer/deploy/RapidsEjb.ear


      Here is the command line I used ( note lines split for readability ):

      C:\Program Files\Oracle\jdev903\jdk\bin\javaw.exe &&
      -ojvm &&
      -classpath &&
      C:\_RAPIDS\rapids\classes; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\concurrent.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\gnu-regexp.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jaas.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jacorb.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-common-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-iiop-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-j2ee.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-jsr77.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-net-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jboss-system-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jbossall-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jbossha-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jbossjmx-ant.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jbossmq-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jbossmqha.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jbosssx-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jcert.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jmx-connector-client-factory.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jmx-ejb-connector-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jmx-rmi-connector-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jnet.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jnp-client.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\jsse.jar; &&
      C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\client\log4j.jar; &&
      C:\Program Files\Oracle\jdev903\jdev\lib\jdev-rt.jar; &&
      C:\Program Files\Oracle\jdev903\lib\xmlparserv2.jar; &&
      C:\Program Files\Oracle\jdev903\lib\xmlcomp.jar &&
      Samplespawar.navy.mil.rapids.ejb.WeatherDetailsEjbClient


      [i]I'm not sure how it knows to use my service ( not the default service ) where my beans are deployed.
      I'm using Oracle Jdeveloper 9.0.3.1.
      I tried to use the JNDI browser from http://www.ejtools.org/applications/jndi.browser but I get lots
      of errors on the JBOSS/RapidsService when I try and deploy it.


      Here is a list of my deployed files:

      Directory of C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\server\RapidsServer\deploy

      05/15/2003 11:28 PM .
      05/15/2003 11:28 PM ..
      05/15/2003 11:34 PM 52,598 RapidsEjb.ear
      05/15/2003 11:34 PM 51,829 RapidsEjb.jar
      11/02/2002 06:55 PM 1,153 user-service.xml
      3 File(s) 105,580 bytes
      2 Dir(s) 1,273,946,112 bytes free


      Here is a list of my config files:


      Directory of C:\OpenSource\JBoss\jboss-3.0.4_tomcat-4.1.12\server\default\conf

      01/30/2003 01:01 PM .
      01/30/2003 01:01 PM ..
      11/02/2002 06:55 PM 489 auth.conf
      11/02/2002 06:56 PM 4,562 jboss-minimal.xml
      11/02/2002 06:55 PM 15,697 jboss-service.xml
      11/02/2002 06:55 PM 941 jbossmq-state.xml
      11/02/2002 06:56 PM 246 jndi.properties
      11/02/2002 06:55 PM 6,700 log4j.xml
      11/02/2002 06:56 PM 5,207 login-config.xml
      11/02/2002 06:55 PM 555 server.policy
      01/28/2003 06:03 PM 19,341 server.xml
      11/02/2002 06:55 PM 36,148 standardjaws.xml
      11/02/2002 06:56 PM 54,895 standardjboss.xml
      11/02/2002 06:55 PM 76,474 standardjbosscmp-jdbc.xml
      12 File(s) 221,255 bytes
      2 Dir(s) 1,273,946,112 bytes free