Step #6: Deploy the DemoBean EJB
In this step we are going to deploy our DemoBean into the EJB server/container.
Overview of Deployment in General
[PENDING]
Deploy the DemoBean EJB into WebLogic/Tengah server/container
Deploy the DemoBean EJB into the Oracle Server side EJB container
WebLogic/Tengah Deployment
- Overview of WebLogic/Tengah deployment
- Generate the implementations
- Put the Demo.jar into the CLASSPATH of the Tengah server
- Put the DeploymentDescriptor into CLASSPATH of Tengah server
- Edit the weblogic.properties file to include the new EJB
- Stop and restart the Tengah server
Overview of WebLogic/Tengah deployment
In the current release of the Tengah server from WebLogic, deployment of the EJB bean means "putting the bean classes where the Tengah server can find them." This is not a difficult thing to do, but it is not very elegant either, and it is expected that tools will simplify this step, as well as make what is happening more obvious.
Note: This example assumes the Tengah server is installed in the /export directory.
Generate the implementations
This step creates the implementations of the interfaces we specified earlier, and the supporting WebLogic-specific classes for our DemoBean . These classes are WebLogic specific and notice that they are not packaged with our bean. The classes that are generated are, for example, the home and remote interfaces, as well 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 what enables EJB to be protocol neutral.
Note: We assume that the Tengah 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 WebLogic tools, use:
java weblogic.ejbc -d /export/weblogic/classes ejb/demo/DemoBeanDD.ser
This utility will create classes with names similar to those below and will put 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
Put the Demo.jar into CLASSPATH of Tengah 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 Tengah Server on UNIX systems
CLASSPATH=$CLASSPATH:/export/weblogic/classes/Demo.jar
echo $CLASSPATH
java -ms16m -mx16m -verbosegc weblogic.Server
Put the DeploymentDescriptor in place
Currently, the Tengah server appears to be unable to find the serialised deployment descriptor within the ejb-jar file, and the descriptor needs to be copied out of the jar file into the CLASSPATH of the server.
For example:
cd /export/weblogic/classes
jar xvf Demo.jar ejb/demo/DemoBeanDD.ser
Edit the weblogic.properties file
This file needs to include the loading and startup instructions for the new EJB.
/export/weblogic/weblogic.properties
# # # # # # # # # # # # # # # # # # # # # # # # # #
# Tengah EJB DEMO PROPERTIES
# -------------------------------------------------
# Uncomment the appropriate lines below and modify DBMS-related info
# and paths to match your particular installation.
#
# Deploys the EJBean 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/ejb/demo/DemoBeanDD.ser
#
# weblogic.properties file continues below...
#
Stop and restart the Tengah Server
You can use either the Weblogic tools to stop and restart the Tengah server or in a unix environment simply kill the main Tengah process and use the /expot/weblogic/startTengah.sh script to restart. Please refer to the Weblogic tools documentation for details.
Overview of Deploying the DemoBean EJB into the Oracle server side container.
[PENDING: please note that
the Oracle tools are not yet available, but will be in the near future. They were demonstrated recently at Oracle Openworld in San Francisco]
|