In this step the DemoBean Enterprise JavaBean is installed, or deployed, into
an Enterprise JavaBeans container. It is important to note that each of the
server vendors will have specific and increasingly sophisticated tools to
enable this installation.
Follow the instructions below to install the DemoBean into the BEA Weblogic
server, which you installed in Step 1.
BEA WebLogic Deployment
In the current release of the Weblogic server from BEA WebLogic, deployment of
the Enterprise JavaBeans bean means "putting the bean classes where
the Weblogic server can find them." This is not a difficult thing to do,
but it is not very elegant either, and it is expected that there will be
tools to simplify this step, as well as make what is happening more obvious.
-
Generate the implementations
-
Put the
Demo.jar
into the CLASSPATH of the Weblogic server
-
Edit the
weblogic.properties
file to include the new
Enterprise JavaBean
-
Stop and restart the
Weblogic server
Note: This example assumes the Weblogic server is installed
in the /export
directory.
1. Generate the implementations
This step creates the implementations of the interfaces specified earlier,
and the supporting BEA WebLogic-specific classes for the DemoBean
.
Notice that they are not packaged with your bean. The classes that are
generated are, for example, the home and remote interfaces, as well as the
classes required for supporting the communications protocols. The fact that
these classes are generated at deployment time, and not written by the bean
provider (programmer) is a major part of what enables Enterprise JavaBeans
to be protocol-neutral.
Note: Assume that the Weblogic server has been installed into
the /export
directory. You will need to modify the destination
directory (that is, -d parameter below) if it is installed somewhere else.
To generate the implementations for the DemoBean
using the
BEA WebLogic tools, use:
java weblogic.ejbc -d /export/weblogic/classes ejb/demo/DemoBeanDD.ser
This utility creates classes with names similar to those below and
puts them under the /export/weblogic/classes
directory.
ejb/demo/DemoBeanEOImpl.class
ejb/demo/DemoBeanHomeImpl.class
ejb/demo/Skel5k5x705r2x671nd1i1vy2v524ua5y.class
ejb/demo/Skel5q585f5sfzo601q4e725b233m5140.class
ejb/demo/Stub5k5x705r2x671nd1i1vy2v524ua5y.class
ejb/demo/Stub5q585f5sfzo601q4e725b233m5140.class
2. Put the Demo.jar
into CLASSPATH of Weblogic
server
There are several ways to do this, but the simplest is to put the
Demo.jar
file into the /export/weblogic/classes
directory, then edit the /export/weblogic/startTengah.sh
script to include the Demo.jar
file.
/export/weblogic/startTengah.sh
#!/bin/sh
#
# Shell script to manually start Weblogic
# Server on UNIX systems
CLASSPATH=$CLASSPATH:/export/weblogic/classes/Demo.jar
echo $CLASSPATH
java -ms16m -mx16m -verbosegc weblogic.Server
3. Edit the weblogic.properties
file
Include the loading and startup instructions for the new Enterprise JavaBeans.
/export/weblogic/weblogic.properties
# # # # # # # # # # # # # # # # # # # # # # # # # #
# Weblogic Enterprise JavaBeans DEMO PROPERTIES
# -------------------------------------------------
# Uncomment the appropriate lines below and modify
# DBMS-related info and paths to match your particular
# installation.
#
# Deploys the Enterprise JavaBean examples.
Uncomment to use:
weblogic.ejb.deploy=\
/export/weblogic/classes/beanManaged.jar,\
/export/weblogic/classes/containerManaged.jar,\
/export/weblogic/classes/statefulSession.jar,\
/export/weblogic/classes/DemoBeanDD.jar
#
# weblogic.properties file continues below...
#
4. Stop and restart the Weblogic Server
You can use either the BEA Weblogic tools to stop and restart the Weblogic
server or in a environment simply kill the main Weblogic process, and use
the /expot/weblogic/startTengah.sh
script to restart. For details, see the
BEA Weblogic
tools documentation.
<< BACK
NEXT >>