|
|
| |
WebLogic Server EJB Utilities
The following sections provide a complete reference to the utilities and support files supplied with WebLogic Server EJBs:
Use the weblogic.ejbc command-line utility for generate and compiling EJB 2.0 and 1.1 container classes. If you compile JAR files for deployment into the EJB container, you must use weblogic.ejbc to generate the container classes.
The WebLogic Server command line utility, weblogic.ejbc does the following:
If you specify an output JAR file, ejbc places all generated files into the JAR file.
By default, ejbc uses javac as a compiler. For faster performance, specify a different compiler (such as Symantec's sj) using the -compiler flag.
Note: You may encounter problems deploying EJBs if there is a mismatched version problem with weblogic.ejbc. When you start WebLogic Server it checks which version of weblogic.ejbc was used to compile the container classes. If the version of weblogic.ejbc used to compile the classes is different from the version you are currently running the EJB will not deploy. To avoid this problem, make sure that you do not put unnecessary classes in your class path.
$ java weblogic.ejbc [options] <source jar file>
<target directory or jar file>
Note: If you output to a JAR file, the output JAR name must be different from the input JAR name.
The following table lists the weblogic.ejbc arguments:
The following table lists the weblogic.ejbc command-line options:
Option |
Description |
-help |
Prints a list of all options available for the compiler. |
-version |
Prints ejbc version information. |
-dispatchPolicy <queueName> |
Specifies a configured execute queue that the EJB should use for obtaining execute threads in WebLogic Server. See Using Execute Queues to Control Thread Usage for more information. |
-idl |
Generates CORBA Interface Definition Language for remote interfaces. |
-J |
Specifies the heap size for weblogic.ejbc. Use as follows: |
-idlOverwrite |
Overwrites existing IDL files. |
-idlVerbose |
Displays verbose information while generating IDL. |
-idlDirectory <dir> |
Specifies the directory where ejbc creates IDL files. By default, ejbc uses the current directory. |
-keepgenerated |
Saves the intermediate Java files generated during compilation. |
-compiler <compiler name> |
Sets the compiler for ejbc to use. |
-normi |
Passed through to Symantec's java compiler, sj, to stop generation of RMI stubs. Otherwise sj creates its own RMI stubs, which are unnecessary for the EJB. |
-classpath <path> |
Sets a CLASSPATH used during compilation. This overrides the system or shell CLASSPATH. |
The following example uses the javac compiler against an input JAR file in c:\wlserver\samples\examples\ejb\basic\containerManaged\build. The output JAR file is placed in c:\wlserver\config\examples\applications.
$ java weblogic.ejbc -compiler javac c:\wlserver\samples\examples\ejb\basic\containerManaged\build\std _ejb_basic_containerManaged.jar c:\wlserver\config\examples\ejb_basic_containerManaged.jar
The following example checks a JAR file for compliance with the EJB 1.1 specification and generates WebLogic Server container classes, but does not generate RMI stubs:
$ java weblogic.ejbc -normi c:\wlserver\samples\examples\ejb\basic\containerManaged\build\std _ejb_basic_containerManaged.jar
The DDConverter is a command line utility that converts earlier versions EJB deployment descriptors into EJB deployment descriptors that conform to the WebLogic Server 6.x version. The WebLogic Server EJB container supports both the EJB 1.1 and EJB 2.0 specifications including the EJB 1.1 and EJB 2.0 document type definitions (DTD). Each WebLogic Server EJB deployment includes standard deployment descriptors in the following files:
This XML file contains the Sun Microsoft-specific EJB deployment descriptors.
This XML file contains the WebLogic-specific EJB deployment descriptors.
This XML file contains the WebLogic-specific container-managed persistence (CMP) deployment descriptors.
Conversion Options Available with DDConverter
The DDConverter command line utility includes the following conversion options:
The following table lists the various conversion options for the DDconverter:
Note 1: Converting non-CMP EJB 1.0 beans to non-CMP EJB 1.1 beans is not necessary because the EJB 1.1 non-CMP deployment descriptors are the same as the EJB 2.0 non-CMP deployment descriptors.
Note 2: Use the DDConverter command line option -EJBVer for converting EJB CMP 1.0 to EJB CMP 1.1. See DDConverter Options for a description of this option.
Note 3: Even thought WLS 5.x CMP 1.1 beans and WLS 6.x CMP 1.1 beans are different, WLS 5.1 CMP 1.1 beans can run in WebLogic Server 6.x without any changes to the source code.
You should always recompile the beans after you use the DDConverter. We recommend that you use weblogic.ejbc and then deploy the new generated JAR file. Recompiling the bean makes sure that the code is compliant with the EJB Specifications and saves you time because you can skip the recompile process during server startup.
When converting WLS 5.x EJB 1.1 beans to WLS 6.x EJB 2.0 beans, the input to DDConverter is the WebLogic 5.1 JAR file. This file contains the deployment descriptor files and class files. The output goes to a JAR file that includes the WebLogic 6.0 deployment descriptor files and all necessary class files. See the third row in the Conversion Options for the DDConverter Utility table.
You can convert non-CMP beans to EJB 2.0 beans with little or no changes to the source code. To do this, run weblogic.ejbc on the output.jar file and then deploy the generated JAR file. With CMP beans, you must make changes to the source code using the steps in Using DDConverter to Convert EJBs.
Using DDConverter to Convert EJBs
To convert earlier versions of EJBs for use in WebLogic Server:
The output is a JAR file.
$ java weblogic.ejb20.utils.DDConverter [options] file1 [file2...]
DDConverter takes the argument file1 [file2...], where file is one of the following:
DDConverter uses the beanHomeName property of EJBs in the text deployment descriptor to define new ejb-name elements in the resultant ejb-jar.xml file.
The following table lists the DDConverter command-line options:
The following example converts a WLS 5.x EJB 1.1 bean into a WLS 6.x EJB 2.0 bean.
The JAR file is created in the destDir subdirectory:
$ java weblogic.ejb20.utils.DDConverter -d destDir Employee.jar
Where the Employee bean is a WLS 5.x EJB 1.1 JAR file.
The weblogic.deploy command-line utility is used to deploy an EJB-compliant JAR file, the JAR's EJBs to a running instance of WebLogic Server.
$ java weblogic.deploy [options] [list|deploy|undeploy|update] password {name} {source}
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|