BEA Logo BEA WebLogic Enterprise Release 5.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Enterprise Doc Home   |   Samples & Related Topics   |   Previous Topic   |   Next Topic   |   Contents   |   Index

JNDI Utility Application

 

This topic includes the following sections:

 


How the JNDI Utility Application Works

This application is a utility program that creates a list of all the EJBs deployed on a WebLogic Enterprise server process. This application searches the JNDI tree, and checks each entry to see if it is an EJB; if so, this application displays the following information:

From the name of the service stub, you can determine the package name of the EJB.

 


Building and Running the JNDI Utility Application

To build and run the JNDI utility application, complete the following steps:

  1. Make sure that you have successfully built at least one EJB application; for example, one of the EJB samples documented in this guide.

  2. Set your CLASSPATH to include the EJB JAR files for the EJB applications you have built.

  3. Copy the files for the JNDI utility application into a work directory.

  4. Change the protection attribute on the files for the JNDI utility application

  5. Compile the source file for the JNDI utility application.

  6. Run the JNDI utility application and examine the output.

The sections that follow provide details on steps 3 through 6.

Copying the Files for the JNDI Utility Application into a Work Directory

You need to copy the file for the JNDI utility application into a work directory on your local machine. The following steps describe how to copy all the file into a work directory.

  1. If you are using a UNIX system, enter the ksh command to use the Korn shell:

    prompt>ksh
    ksh prompt>

  2. Create a work directory on your machine under the directory described in step 2 in the section Before you Build and Run the EJB Sample Applications.

  3. Copy the contents of the following directory into the work directory:

    Windows NT

    %TUXDIR%\samples\j2ee\ejb\utils

    UNIX

    $TUXDIR/samples/j2ee/ejb/utils

The files copied into the work directory are:

Changing the Protection Attribute on the Files for the JNDI Utility Application

During the installation of the WebLogic Enterprise software, the sample application files are marked read-only. Before you can edit or build the file in the JNDI utility application, you need to change the protection attribute of the file you copied into your work directory, as follows:

Windows NT

prompt>attrib /S -r drive:\workdirectory\*.*

UNIX

prompt>ksh

ksh prompt>chmod +w /workdirectory/*.*

Compiling the Source File for the JNDI Utility Application

Compile the source file for the JNDI utility application. For example, on Windows NT, enter the following command:

prompt> javac ListAll.java

 


Running the JNDI Utility Application and Examining the Output

To run the JNDI utility application, complete the following steps:

  1. Change to the EJB application's work directory, if necessary.

  2. Boot the EJB application and run the client by entering the following commands:

    Windows NT

    prompt>tmboot -y
    prompt>run_client.cmd

    UNIX

    prompt>tmboot -y
    prompt>./run_client.ksh

  3. Change to the JNDI application's work directory.

  4. Run the JNDI utility program, as in the following command:

    prompt> java ListAll corbaloc://host:port

    In the preceding command, host:port represent the TCP/IP address of the IIOP listener/handler for the WebLogic Enterprise domain.

  5. Examine the output displayed by the JNDI utility application, which may appear similar to the following:

    Starting to search tree for all EJBeans... 

    EJBean Binding Name: statelessSession.TraderHome
    Classname: samples.j2ee.ejb.basic.statelessSession.TraderBeanHomeImpl_WLStub

    Finished searching tree for all EJBeans...