0 Replies Latest reply on Mar 25, 2002 3:57 PM by milesif

    JBoss3.0 JNDI lookup problem

    milesif

      It seems I have problems binding a stateless session to the naming service.

      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>
      <enterprise-beans>

      <ejb-name>ProveJBossSession</ejb-name>
      provejboss30session.JBSessionHome
      provejboss30session.JBSessionRemote
      <ejb-class>provejboss30session.JBSessionBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

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


      my jboss.xml is

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

      <enterprise-beans>

      <ejb-name>ProveJBossSession</ejb-name>
      <jndi-name>prove/Prova</jndi-name>

      </enterprise-beans>



      To deploy my the app I put the jar under the deploy directory and I got the following message (nothing else):

      21:00:16,360 INFO [MainDeployer] Deploying: file:/C:/JBoss3.0Beta/jboss-3.0.0be
      ta/deploy/provejboss30session.jar


      when I execute the following look-up code:

      Properties p = new Properties();
      p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      p.put("java.naming.provider.url","jnp://franz330:1099");
      p.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      Context ctx = new InitialContext(p);
      Object o = ctx.lookup("prove/Prova");
      JBSessionHome h = (JBSessionHome) PortableRemoteObject.narrow(o, JBSessionHome.class);
      JBSessionRemote r = h.create();

      I get the following error:
      javax.naming.NameNotFoundException: prove not bound at org.jnp.server.NamingServer_Stub.lookup(Unknown Source) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:365) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349) at javax.naming.InitialContext.lookup(InitialContext.java:350) at provejboss30session.test.go(test.java:44) at provejboss30session.test.main(test.java:57)


      I really cannot find the error. I have used JBoss before and I never had such a problem.
      I also removed the home and remote class from my jar and when I deployed it I got no error. maybe something in the deployment procedure has changed.
      Thanks in advance

      Ciao Francesco