- EJB Deployment Descriptor Top-Level Elements
- EJB JAR Files
- EJB Deployment Procedures
- Example BEA WebLogic Server Startup and Deployment
- Conclusions
Example BEA WebLogic Server Startup and Deployment
I will now briefly discuss deployment via the BEA WebLogic Server exemplifying an enterprise class server capable of deploying J2EE-based EJB applications. Generally, you first want to compile all server Java classes and then copy any EJB ejb-jar.xml files under a META-INF directory created below a special temporary WebLogic build directory. Special WebLogic-specific configuration and deployment parameters are defined in a weblogic-ejb-jar.xml file for all beans and a weblogic-cmp-rdbms-jar.xml file for entity beans. These descriptor files are also copied to the META-INF directory.
You then must create a standard JAR file out of all compiled classes and XML deployment descriptor files, and subsequently call a special WebLogic Server weblogic.ejbc program to create the EJB JAR file. The weblogic.ejbc program is a Java program that creates all necessary client- and server-side stubs, skeletons, and delegates for the EJB classes. The basic format of weblogic.ejbc used is shown here:
[JAVA_HOME]\bin\java -classpath [CLASSPATH] -Dweblogic.home=[WEBLOGIC_HOME] weblogic.ejbc -compiler javac [build_directory]\standardJarFileName.jar [WEBLOGIC_HOME]\myserver\EJBJarFileName.jar
The [CLASSPATH] value after the -classpath flag specifies those class files and libraries to use during compilation with the Java compiler defined after the -compiler flag. The location and filename of the standard JAR file previously built with your compiled EJB classes and interfaces must also be provided on the command line (that is, [build_directory]\standardJarFileName.jar), along with the desired location and filename for the EJB JAR file to be created by weblogic.ejbc (that is, [WEBLOGIC_HOME]\myserver\EJBJarFileName.jar).
Before deploying the EJBs, each EJB JAR file location and name must also be added to the weblogic.properties file's weblogic.ejb.deploy property. The weblogic.properties file is a special Java property file contained in the WEBLOGIC_HOME directory to define instance-specific configuration parameters for the WebLogic Server. The BEA WebLogic Server can then be started using a special command script, a starter script for which comes equipped with the WebLogic Server in the WEBLOGIC_HOME directory.