Oracle8i Enterprise JavaBeans and CORBA Developer's Guide
Release 8.1.5






Prev  Chap Top Next

Enterprise JavaBean Tools

Instead of loadjava and publish, Enterprise JavaBean developers use the deployejb tool, which does equivalent operations, as well as generating and compiling infrastructure code for the EJB. The ejbdescriptor tool is a utility for translating between the text and serialized object forms of EJB deployment descriptors.


From a deployment descriptor and a JAR containing interfaces and classes, the deployejb tool makes an EJB implementation ready for test or production clients to invoke. deployejb converts the text descriptor to a serialized object, generates and compiles classes that effect client-bean communication, loads compiled classes into the database, and publishes the bean's home interface name in the session namespace so clients can look it up with JNDI. The BeanHomeName must refer to a PublishingContext for which the deployejb invoker has the write right; see "publish" for the rights required to publish.

To invoke a deployed bean, the client's CLASSPATH must include the remote and home interface files and the JAR generated by deployejb.


deployejb -user <username> -password <password> -service <serviceURL> 
-descriptor <file> -temp <dir> <beanjar>
  [-addclasspath <dirlist>]  
  [-generated <clientjar>] 
  [-role <role>] 

Argument Summary

Table 6-18 summarizes the deployejb arguments.

Table 6-18 deployejb Argument Summary


Description and Values 


Specifies the schema into which the EJB classes will be loaded.  


Specifies the password for <username>.  


URL identifying database in whose session namespace the EJB is to be published. The serviceURL has the form:


<host> is the computer that hosts the target database; <lport> is the listener port configured to listen for session IIOP; <sid> is the database instance identifier. Example:


which matches the default installation on the invoker's machine.  


Specifies the text file containing the EJB deployment descriptor.  


Specifies a temporary directory to hold intermediate files deployejb creates. Unless you specify -keep, deployejb removes the files and the directory when it completes.  


Specifies the name of the JAR containing the bean interface and implementation files.  


Specifies directories containing interface and/or implementation dependency classes not contained in <beanjar>. Format of <dirlist> is the same as javac's CLASSPATH argument. Required for -beanonly.  


Skips generation of interface files. This is useful if you change only the bean implementation.  


Summarizes the tool's operation, then exits.  


Specifies the name of the output (generated) JAR file, which contains communication files bean clients need. If you do not specify, the output JAR file has the name of the input JAR file with _generated appended.  


Summarizes the tool's syntax, then exits.  


Connects to the target database with IIOP instead of the default session IIOP. Use this option when deploying to a database server that has been configured without session IIOP.  


Do not remove the temporary files generated by the tool. This option may be useful for debugging because it provides access to the source files deployejb generates.  


Replaces the published BeanHomeName attributes if the BeanHomeName has already been published, otherwise publishes it.  


Specifies role to assume when connecting to the database; no default.  


Connects to the database with SSL authentication and encryption.  


Emits detailed status information while running.  


Shows the tool's version, then exits.  

Argument Details


deployejb needs the classes the home and remote interfaces depend on and the classes the bean implementation depends on. These dependency classes can either be included in the <beanjar> file or directories containing them or can be specified in the -addclasspath argument. The first approach is less prone to error, the second can substantially reduce deployejb's run time. If you use -addclasspath, then you must ensure that the classes have been loaded before you run a client that activates the EJB.

Here is a deployejb example.

Basic invocation specifying the name of the generated client JAR file:

deployejb -user scott -password tiger -service sess_iiop://dbserver:2481:orcl \
  -descriptor myBeanDescriptor.txt -temp /tmp/ejb \ 
  -generated myBeanClient.jar myBean.jar


Each EJB implementation includes a serialized Java object known as a deployment descriptor. The values in a deployment descriptor are not readable by people, yet people must create them and may sometimes have to read them. The ejbdescriptor tool transforms a serialized deployment descriptor to text and vice versa. Developers are most likely to use ejbdescriptor to extract the deployment descriptor data from an EJB developed for a non-Oracle environment. The deployejb tool calls ejbdescriptor to build a deployment descriptor from the text file you specify in the -descriptor argument.


  {-parse | -dump}
  <infile> <outfile> 

Argument Summary

Table 6-19 describes the ejbdescriptor arguments.

Table 6-19 ejbdescriptor Argument Summary
Option  Description 


Creates serialized deployment descriptor <outfile> from <infile>.  


Creates text file <outfile> from serialized deployment descriptor <infile>.  


Name of text file (-parse) or serialized deployment descriptor (-dump) to read. The default is standard in. The conventional suffix for a descriptor text file is .ejb; for a serialized descriptor it is .ser.  


Name of text file (-dump) or serialized deployment descriptor (-parse) to write. The default is standard out. The conventional suffix for a descriptor text file is .ejb; for a serialized descriptor it is .ser.  

Here are examples of the ejbdescriptor tool.

Create a text file representation of a descriptor:

ejbdescriptor -dump beandescriptor.ser beandescriptor.ejb

Create a serialized deployment descriptor from a text file:

ejbdescriptor -parse beandescriptor.ejb beandescriptor.ser

Display the contents of a deployment descriptor:

ejbdescriptor -dump beandescriptor.ser



Copyright © 1999 Oracle Corporation.

All Rights Reserved.