3 Replies Latest reply on May 17, 2005 5:31 AM by Carl Boshoff

    JNDI Configuration in JBoss 4.0

    Arghadeep Chatterjee Newbie

      Can someone pleaseeeeeeee tell me how to configure a new jndi say beanjndi in Jboss 4.0.I have finished searching the whole site for this. Any help is highly appreciated.Please

        • 1. Re: JNDI Configuration in JBoss 4.0
          Carl Boshoff Newbie

          Hey, I'm also new to JBoss, I have a couple of examples working, and I used this in the jndi.properties file, check if it works for your prog...

          java.naming.provider.url=Your JBoss server ip example: jnp://
          j2ee.clientName=Your client app name example: ExampleApp

          • 2. Re: JNDI Configuration in JBoss 4.0
            Carl Boshoff Newbie

            sorry I missread the q, you'll probably also need these:

            ps. you should replace the display-name, home and remote to your program's names

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE application-client PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN' 'http://java.sun.com/dtd/application-client_1_3.dtd'>
             <display-name>ExampleGUI</display-name> <!-- also the client app name in my case. -->
             <home>ExampleHome</home> <!-- home interface (extends EJBHome) -->
             <remote>Example</remote> <!-- this is an interface (extends EJBObject) -->

             <jndi-name>ExampleController</jndi-name> <!-- ejb (implements SessionBean) -->

            Manifest-Version: 1.0
            Ant-Version: Apache Ant 1.6.2
            Created-By: Carl Boshoff
            main-class: ExampleGUI

            I think this everything now, If I remember something else, I'll post here again.

            • 3. Re: JNDI Configuration in JBoss 4.0
              Carl Boshoff Newbie

              to connect to the jboss server you need this:

               Context initial = new InitialContext();
               Context myEnv = (Context)initial.lookup("java:comp/env");
               Object objref = myEnv.lookup("ejb/ExampleRef");
               ExampleHome home = (ExampleHome)PortableRemoteObject.narrow(objref, ExampleHome.class);
               Example example = home.create();