3 Replies Latest reply on Mar 12, 2003 9:36 AM by airman

    EJB called outside the server ? how it works

    airman

      Hi,

      I have some EJBs session in my Jboss server. I'd want to use it outside the server, from a main method in a simple class.

      I'd want to run it all in Eclipse for example.

      What must I do ?

      I'v tried this, but it does not work :

      NOTE : "ejb/com/watoo/j2ee/business/administration/TestFacade" is my JNDI name defined in the jboss.xml file.

      public void main () {
      myProperties.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      myProperties.setProperty("java.naming.provider.url", "127.0.0.1:1099");
      myProperties.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      InitialContext myInitialContext = new InitialContext(myProperties);
      myRef = myInitialContext.lookup("ejb/com/watoo/j2ee/business/administration/TestFacade");
      TestFacadeHome home = (TestFacadeHome) PortableRemoteObject.narrow(myRef, TestFacadeHome.class);
      this.myFacade = home.create();
      }



      Thank you for helping me
      Oliver