All Examples All EJB Examples This Group
This example is a package that demonstrates an Enterprise JavaBean. Please run this example before attempting to create your own Enterprise JavaBeans, as it will show you the different steps involved. The example is a stateless session EJBean called ChildBean that inherits methods from a ParentBean.
The example demonstrates:
To get the most out of this example, first read through the source code files to see what is happening. Start with DeploymentDescriptor.txt to find the general structure of the EJBean, which classes are used for the different objects and interfaces, then look at Client.java to see how the application works.
In general, you'll need to adjust certain properties to match your setup. You'll need to edit the entry for the property that begins with "weblogic.ejb.deploy" in the weblogic.properties file to deploy the EJBeans. The property is commented out in the default properties file; make sure that you uncomment out all the lines of the property.
This example is shipped "pre-built"; you can either run it as shipped, or build the example and run it to test that you are able to successfully build and run EJBeans.
These three sections cover what to do:
We provide separate build scripts for Windows NT and UNIX:
The "build" scripts build individual examples, such as these entries for Windows:
$ build subclass parent
$ build subclass childYou'll need to build the parent example first before building the child example. To build under Microsoft's JDK for Java, use
$ build subclass parent -msThese scripts will build the example and place the files in the correct locations:
We provide a commented-out version in the property that begins with "weblogic.ejb.deploy" that you can use. You'll need to adjust the property depending on which EJBeans you're building and are deploying, or if the location of the files differs from the installed location.
Note: If you're running under the Microsoft SDK for Java, you'll also need to add the path to the .jar to the CLASSPATH for your WebLogic Server.
$ java examples.ejb.subclass.child.Client
If you're not running the WebLogic Server with its default settings, you will have to run the client using:
$ java examples.ejb.subclass.child.Client "t3://WebLogicURL:Port"
where:
Parameters are optional, but if any are supplied, they are interpreted in this order:
Begin child.Client... Creating child... Calling Child's "childSaysHello()" method... Hello from the ChildBean. Calling Child's "parentSaysHello()" method... Hello from the ChildBean overload of the "parentSaysHello()" method. Calling Child's "parentMethodOnly()" method... This method is only in the ParentBean. End child.Client...
Copyright © 1998-1999 BEA Systems, Inc.. All rights reserved.
Last updated 12/10/98