All Examples  All EJB Examples

Package Index

Enterprise JavaBean utilities example
packages and classes

about this example

This example is a utility program that creates a list of all the EJBeans deployed on a WebLogic Server. It recursively travels the JNDI tree, and checks each entry to see if it is an EJBean; if so, it prints out the JNDI name of the EJBean's home and the classname of the service stub that the client is accessing. From the name of the service stub you can determine the package name of the EJBean.

how to use this example

Follow these steps to build and run the utility:
  1. Set your CLASSPATH to include the WebLogic /classes directory, the weblogicaux.jar file in the WebLogic /lib directory and the /myserver/clientclasses directory.

  2. Compile the Java files in this directory into the WebLogic classes directory, with the javac -d option, as shown in this example for Windows:
     $ javac -d ..\..\..\myserver\clientclasses ListAll.java

  3. Start the WebLogic Server.

  4. Run the utility program:
     $ java examples.ejb.utils.ListAll

    If you're not running the WebLogic Server with its default settings, you will have to run the utility using:

    $ java examples.ejb.utils.ListAll "t3://WebLogicURL:Port"

    where:

    WebLogicURL
    Domain address of the WebLogic Server
    Port
    Port that is listening for connections (weblogic.system.ListenPort)

    Parameters are optional, but if any are supplied, they are interpreted in this order:

    Parameters:
    url - URL such as "t3://localhost:7001" of Server
    user - User name, default null
    password - User password, default null

    Depending on the EJBeans you have deployed, you'll see output similar to this:

    Starting to search tree for all EJBeans...
    
    EJBean Home: containerManaged/AccountHome
    Classname: examples.ejb.basic.containerManaged.AccountBeanHomeImpl_WLStub
    
    EJBean Home: isModifiedBeanManaged/AccountHome
    Classname: examples.ejb.extensions.isModifiedBeanManaged.AccountBeanHomeImpl_WLStub
    
    EJBean Home: isModified/AccountHome
    Classname: examples.ejb.extensions.isModified.AccountBeanHomeImpl_WLStub
    
    EJBean Home: beanManaged/AccountHome
    Classname: examples.ejb.basic.beanManaged.AccountBeanHomeImpl_WLStub
    
    Finished searching tree for all EJBeans...

there's more

Read more about EJB in BEA WebLogic Server Enterprise Java Beans.

Copyright © 1999-2000 BEA Systems, Inc. All rights reserved.

Last updated 01/12/2000