1 Reply Latest reply on Jul 25, 2004 9:55 AM by Darran Lofthouse

    Problem instantiating a SessionBean from Java client applica

    Charles White Newbie


      I'm newbie using JBoss, and I'm trying to create my first "Hello World"
      Session Bean and client java application with JBoss IDE.

      My configuration is:
      JBoss 3.2.5
      Eclipse 3.0

      under Windows XP

      At this moment, I've made the Bean, with the ejb-jar.xml and JBoss.xml
      files and I've exported it in a JAR file named Hello.jar into $JBOSS_HOME/server/default/deploy,

      obtaining the next messages in
      the Eclipse console pane:

      17:06:37,530 INFO [EjbModule] Deploying Hello
      17:06:37,931 INFO [EJBDeployer] Deployed: file:/D:/jboss325/server/default/deploy/Hello.jar

      The contents of the JBoss.xml are





      And the contents of the ejb-jar.xml file are




      Until this point I've thought "everything is OK", so I started with the client

      Firstly, I've included in the Eclipse client project class path, the files


      After that, I've made a single class client with only a main method. It begins:

      Properties props = new Properties();
      props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      props.put("java.naming.factory.url.pkgs", "org.jboss.naming.client");
      props.put("java.naming.provider.url", "jnp://localhost:1099");
      Context ctx = new InitialContext(props);

      After that, I've tried

      HelloHome home = (HelloHome) ctx.lookup("ejb/Hello");

      My client app compiles allright but in the line above I receive the
      following exception:

      javax.naming.NameNotFoundException: ejb not bound
      ....(StackTrace lines)

      I've tried changing the JNDI path (ejb/Hello) and including
      another files in the client classpath from the JBoss client folder
      with the same result.

      I don´t know if I'm incorrectly deploying my SessionBean, If I made
      a mistake in the client code or xml configuration files, or what
      can be wrong. Both client app and SessionBean are expected to run
      in the same computer.

      Can anybody help me to solve the problem?

      Thanks in advance ( And sorry for my English, I'm Spanish ;) )