| Task | Application Servers |
| ddcreator | Weblogic 4.5.1 |
| ejbc | Weblogic 4.5.1 |
| iplanet-ejbc | iPlanet Application Server 6.0 |
| wlrun | Weblogic 4.5.1, 5.1 & 6.0 |
| wlstop | Weblogic 4.5.1, 5.1 & 6.0 |
| ejbjar | iPlanet Application Server 6.0
Weblogic 5.1 & 6.0 |
| Attribute | Description | Required |
| descriptors | This is the base directory from which descriptors are selected. | Yes |
| dest | The directory where the serialised deployment descriptors will be written | Yes |
| classpath | This is the classpath to use to run the underlying weblogic ddcreator tool. This must include the weblogic.ejb.utils.DDCreator class | No |
<ddcreator descriptors="${dd.dir}"
dest="${gen.classes}"
classpath="${descriptorbuild.classpath}">
<include name="*.txt" />
</ddcreator>
The ant task which runs this tool is able to compile several beans in a single operation. The beans to be compiled are selected by including their serialised deployment descriptors. The standard ant include and exclude constructs can be used to select the deployment descriptors to be included.
Each descriptor is examined to determine whether the generated classes are out of date and need to be regenerated. The deployment descriptor is de-serialized to discover the home, remote and implementation classes. The corresponding source files are determined and checked to see their modification times. These times and the modification time of the serialised descriptor itself are compared with the modification time of the generated classes. If the generated classes are not present or are out of date, the ejbc tool is run to generate new versions.
| Attribute | Description | Required |
| descriptors | This is the base directory from which the serialised deployment descriptors are selected. | Yes |
| dest | The base directory where the generated classes, RIM stubs and RMI skeletons are written | Yes |
| manifest | The name of a manifest file to be written. This manifest will contain an entry for each EJB processed | Yes |
| src | The base directory of the source tree containing the source files of the home interface, remote interface and bean implementation classes. | Yes |
| classpath | This classpath must include both the weblogic.ejbc class and the classfiles of the bean, home interface, remote interface, etc of the bean being processed. | No |
<ejbc descriptors="${gen.classes}"
src="${src.dir}"
dest="${gen.classes}"
manifest="${build.manifest}"
classpath="${descriptorbuild.classpath}">
<include name="*.ser" />
</ejbc>
For each EJB specified, the task will locate the three classes that comprise the EJB in the destination directory. If these class files cannot be located in the destination directory, the task will fail. The task will also attempt to locate the EJB stubs and skeletons in this directory. If found, the timestamps on the stubs and skeletons will be checked to ensure they are up to date. Only if these files cannot be found or if they are out of date will the iPlanet Application Server ejbc utility be called to generate new stubs and skeletons.
| Attribute | Description | Required |
| ejbdescriptor | Standard EJB 1.1 XML descriptor (typically titled "ejb-jar.xml"). | Yes |
| iasdescriptor | iPlanet Application Server-specific EJB XML descriptor (typically titled "ias-ejb-jar.xml). | Yes |
| dest | The is the base directory where the RMI stubs and skeletons are written. In addition, the class files for each bean (home interface, remote interface, and EJB implementation) must be found in this directory. | Yes |
| classpath | The classpath used when generating EJB stubs and skeletons. If omitted, the classpath specified when Ant was started will be used. Nested "classpath" elements may also be used. | No |
| keepgenerated | Indicates whether or not the Java source files which are generated by ejbc will be saved or automatically deleted. If "yes", the source files will be retained. If omitted, it defaults to "no". | No |
| debug | Indicates whether or not the ejbc utility should log additional debugging statements to the standard output. If "yes", the additional debugging statements will be generated. If omitted, it defaults to "no". |
|
| iashome | May be used to specify the "home" directory for this iPlanet Application Server installation. This is used to find the ejbc utility if it isn't included in the user's system path. If specified, it should refer to the "[install-location]/iplanet/ias6/ias" directory. If omitted, the ejbc utility must be on the user's system path. | No |
<iplanet-ejbc ejbdescriptor="ejb-jar.xml"
iasdescriptor="ias-ejb-jar.xml"
dest="${build.classesdir}"
classpath="${ias.ejbc.cpath}" />
<iplanet-ejbc ejbdescriptor="ejb-jar.xml"
iasdescriptor="ias-ejb-jar.xml"
dest="${build.classesdir}"
keepgenerated="yes"
debug="yes"
iashome="${ias.home}" >
<classpath>
<pathelement path="." />
<pathelement path="${build.classpath}" />
</classpath>
</iplanet-ejbc>
| Attribute | Description | Required for 4.5.1 and 5.1 | Required for 6.0 |
| BEA Home | The location of the BEA Home qwhere the server's config is defined. If this attribute is present, wlrun assumes that the server will be running under Weblogic 6.0 | N/A | Yes |
| home | The location of the weblogic home that is to be used. This is the location where weblogic is installed. | Yes | Yes. Note this is the absolute location, not relative to BEA home. |
| Domain | The domain to which the server belongs. | N/A | Yes |
| classpath | The classpath to be used with the Java Virtual Machine that runs the Weblogic Server. Prior to Weblogic 6.0, this is typically set to the Weblogic boot classpath. Under Weblogic 6.0 this should include all the weblogic jars | Yes | Yes |
| wlclasspath | The weblogic classpath used by the Weblogic Server. | No | N/A |
| properties | The name of the server's properties file within the weblogic home directory used to control the weblogic instance. | Yes | N/A |
| name | The name of the weblogic server within the weblogic home which is to be run. This defaults to "myserver" | No | No |
| policy | The name of the security policy file within the weblogic home directory that is to be used. If not specified, the default policy file weblogic.policy is used. | No | No |
| username | The management username used to manage the server | N/A | No |
| password | The server's management password | N/A | Yes |
| pkPassword | The private key password so the server can decrypt the SSL private key file | N/A | No |
| jvmargs | Additional argument string passed to the Java Virtual Machine used to run the Weblogic instance. | No | No |
| args | Additional argument string passed to the Weblogic instance. | No | No |
<wlrun taskname="myserver"
classpath="${weblogic.boot.classpath}"
wlclasspath="${weblogic.classes}:${code.jars}"
name="myserver"
home="${weblogic.home}"
properties="myserver/myserver.properties"/>
This example shows wlrun being used to run the petstore server under Weblogic
6.0
<wlrun taskname="petstore"
classpath="${weblogic.classes}"
name="petstoreServer"
domain="petstore"
home="${weblogic.home}"
password="petstorePassword"
beahome="${bea.home}"/>
This task works for most version of Weblogic, including 6.0. You need to specify the BEA Home to have this task work correctly under 6.0
| Attribute | Description | Required |
| BEAHome | This attribute selects Weblogic 6.0 shutdown. | No |
| classpath | The classpath to be used with the Java Virtual Machine that runs the Weblogic Shutdown comment. | Yes |
| user | The username of the account which will be used to shutdown the server | Yes |
| password | The password for the account specified in the user parameter. | Yes |
| url | The URL which describes the port to which the server is listening for T3 connections. For example, t3://localhost:7001 | Yes |
| delay | The delay in seconds after which the server will stop. This defaults to an immediate shutdown. | No |
<wlstop classpath="${weblogic.classes}"
user="system"
url="t3://localhost:7001"
password="foobar"
beahome="${bea.home}"/>
The task works as a directory scanning task, and performs an action for each deployment descriptor found. As such the includes and excludes should be set to ensure that all desired EJB1.1 descriptors are found, but no application server descriptors are found. For each descriptor found, ejbjar will parse the deployment descriptor to determine the necessary class files which implement the bean. These files are assembled along with the deployment descriptors into a well formed EJB jar file. Any support files which need to be included in the generated jarcan be added with the <support> nested element. For each class included in the jar, ejbjar will scan for any super classes or super interfaces. These will be added to the generated jar.
If no nested vendor-specific deployment elements are present, the task will simply generate a generic EJB jar. Such jars are typically used as the input to vendor-specific deployment tools. For each nested deployment element, a vendor specific deployment tool is run to generate a jar file ready for deployment in that vendor's EJB container.
The jar files are only built if they are out of date. Each deployment tool element will examine its target jar file and determine if it is out of date with respect to the class files and deployment descriptors that make up the bean. If any of these files are newer than the jar file the jar will be rebuilt otherwise a message is logged that the jar file is up to date.
| Attribute | Description | Required |
| descriptordir | The base directory under which to scan for EJB deployment descriptors. If this attribute is not specified, then the deployment descriptors must be located in the directory specified by the 'srcdir' attribute. | No |
| srcdir | The base directory containing the .class files that make up the bean. Note that this can be the same as the descriptordir if all files are in the same directory tree. | Yes |
| destdir | The base directory into which generated jar files are deposited. Jar files are deposited in directories corresponding to their location within the descriptordir namespace. Note that this attribute is only used if the task is generating generic jars (i.e. no vendor-specific deployment elements have been specified). | Yes |
| basejarname | The base name that is used for the generated jar files. If this attribute is specified, the generic jar file name will use this value as the prefix (followed by the value specified in the 'genericjarsuffix' attribute) and the resultant ejb jar file (followed by any suffix specified in the nested element). | No |
| basenameterminator | String value used to substring out a string from the name of each deployment descriptor found, which is then used to locate related deployment descriptors (e.g. the WebLogic descriptors). For example, a basename of '.' and a deployment descriptor called 'FooBean.ejb-jar.xml' would result in a basename of 'FooBean' which would then be used to find FooBean.weblogic-ejb-jar.xml and FooBean.weblogic-cmp-rdbms-jar.xml, as well as to create the filenames of the jar files as FooBean-generic.jar and FooBean-wl.jar. This attribute is not used if the 'basejarname' attribute is specified. | No, defaults to '-'. |
| genericjarsuffix | String value appended to the basename of the deployment descriptor to create the filename of the generic EJB jar file. | No, defaults to '-generic.jar'. |
| classpath | This classpath is used when resolving classes which are to be added to the jar. Typically nested deployment tool elements will also support a classpath which will be combined with this classpath when resolving classes | No. |
| flatdestdir | Set this attribute to true if you want all generated jars to be placed in the root of the destdir, rather than according to the location of the deployment descriptor within the descriptor dir hierarchy. | No. |
| Attribute | Description | Required |
| publicId | The public Id of the DTD for which the location is being provided | Yes |
| location | The location of the local copy of the DTD. This can either be a file or a resource loadable from the classpath. | Yes |
There are a few problems with this scheme. It does not allow for more than one CMP descriptor to be defined in a jar and it is not compatible with the deployment descriptors generated by some tools.
In Ant 1.3, ejbjar parses the weblogic deployment descriptor to discover
the CMP descriptors, which are then included automatically. This behaviour
is controlled by the newCMP attribute. Note that if you move to the new
method of determining CMP descriptors, you will need to update your weblogic
deployment descriptor's <type-storage> element. In the above example,
you would define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.
| Attribute | Description | Required |
| destdir | The base directory into which the generated weblogic ready jar files are deposited. Jar files are deposited in directories corresponding to their location within the descriptordir namespace. | Yes |
| genericjarsuffix | A generic jar is generated as an intermediate step in build the weblogic deployment jar. The suffix used to generate the generic jar file is not particularly important unless it is desired to keep the generic jar file. It should not, however, be the same as the suffix setting. | No, defaults to '-generic.jar'. |
| suffix | String value appended to the basename of the deployment descriptor to create the filename of the WebLogic EJB jar file. | No, defaults to '.jar'. |
| classpath | The classpath to be used when running the weblogic ejbc tool. Note that this tool typically requires the classes that make up the bean to be available on the classpath. Currently, however, this will cause the ejbc tool to be run in a separate VM | No |
| wlclasspath | Weblogic 6.0 will give a warning if the home and remote interfaces of a bean are on the system classpath used to run weblogic.ejbc. In that case, the standard weblogic classes should be set with this attribute (or equivalent nested element) and the home and remote interfaces located with the standard classpath attribute | No |
| keepgeneric | This controls whether the generic file used as input to ejbc is retained. | No, defaults to false |
| compiler | This allows for the selection of a different compiler to be used for the compilation of the generated Java files. This could be set, for example, to Jikes to compile with the Jikes compiler. | No |
| rebuild | This flag controls whether weblogic.ejbc is always invoked to build the jar file. In certain circumstances, such as when only a bean class has been changed, the jar can be generated by merely replacing the changed classes and not rerunning ejbc. Setting this to false will reduce the time to run ejbjar. | No, defaults to true. |
| keepgenerated | Controls whether weblogic will keep the generated Java files used to build the class files added to the jar. This can be useful when debugging | No, defaults to false. |
| args | Any additional arguments to be passed to the weblogic.ejbc tool. | No. |
| weblogicdtd | Deprecated. Defines the location of the ejb-jar DTD in the weblogic class hierarchy. This should not be necessary if you have weblogic in your classpath. If you do not, you should use a nested <dtd> element, described above. If you do choose to use an attribute, you should use the ejbdtd attribute in preference to this one, anyway. | No. |
| wldtd | Deprecated. Defines the location of the weblogic-ejb-jar DTD which covers the Weblogic specific deployment descriptors. This should not be necessary if you have weblogic in your classpath. If you do not, you should use a nested <dtd> element, described above. | No. |
| ejbdtd | Deprecated. Defines the location of the ejb-jar DTD in the weblogic class hierarchy. This should not be necessary if you have weblogic in your classpath. If you do not, you should use a nested <dtd> element, described above. | No. |
| newCMP | If this is set to true, the ne wmethod for locating CMP descriptors will be used. | No. Defaults to false |
| oldCMP | Deprecated This is an antonym for newCMP which should be used instead. | No. |
The weblogic nested element itself supports two nested elements <classpath> and <wlclasspath> which are used to set the respective classpaths. These nested elements are useful when setting up class paths using reference Ids.
| Attribute | Description | Required |
| toplinkdescriptor | This specifies the name of the TOPLink deployment descriptor file contained in the 'descriptordir' directory. | Yes |
| toplinkdtd | This specifies the location of the TOPLink DTD file. This can be a file path or a file URL. This attribute is not required, but using a local DTD is recommended. | No, defaults to dtd file at www.objectpeople.com. |
<ejbjar srcdir="${build.classes}"
descriptordir="${descriptor.dir}">
<weblogic destdir="${deploymentjars.dir}"
classpath="${descriptorbuild.classpath}"/>
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*weblogic*.xml"/>
</ejbjar>
If weblogic is not in the Ant classpath, the following example shows how
to specify the location of the weblogic DTDs. This example also show the
use of a nested classpath element.
<ejbjar descriptordir="${src.dir}" srcdir="${build.classes}">
<weblogic destdir="${deployment.webshop.dir}"
keepgeneric="true"
args="-g -keepgenerated ${ejbc.compiler}"
suffix=".jar"
oldCMP="false">
<classpath>
<pathelement path="${descriptorbuild.classpath}"/>
</classpath>
</weblogic>
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*-weblogic-ejb-jar.xml"/>
<dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
location="${weblogic.home}/classes/weblogic/ejb/deployment/xml/ejb-jar.dtd"/>
<dtd publicId="-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"
location="${weblogic.home}/classes/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd"/>
</ejbjar>
This example shows ejbjar being used to generate a single deployment jar
using a Weblogic EJB container. This example does not require the deployment
descriptors to use the naming standard. This will create only one ejb jar
file - 'TheEJBJar.jar'.
<ejbjar srcdir="${build.classes}"
descriptordir="${descriptor.dir}"
basejarname="TheEJBJar">
<weblogic destdir="${deploymentjars.dir}"
classpath="${descriptorbuild.classpath}"/>
<include name="**/ejb-jar.xml"/>
<exclude name="**/weblogic*.xml"/>
</ejbjar>
This example shows ejbjar being used to generate deployment jars for a
TOPLink-enabled entity bean using a Weblogic EJB container. This example
does not require the deployment descriptors to use the naming standard.
This will create only one TOPLink-enabled ejb jar file - 'Address.jar'.
<ejbjar srcdir="${build.dir}"
destdir="${solant.ejb.dir}"
descriptordir="${descriptor.dir}"
basejarname="Address">
<weblogictoplink destdir="${solant.ejb.dir}"
classpath="${java.class.path}"
keepgeneric="false"
toplinkdescriptor="Address.xml"
toplinkdtd="file:///dtdfiles/toplink-cmp_2_5_1.dtd"
suffix=".jar"/>
<include name="**/ejb-jar.xml"/>
<exclude name="**/weblogic-ejb-jar.xml"/>
</ejbjar>
This final example shows how you would set-up ejbjar under Weblogic 6.0.
It also shows the use of the <support> element to add support files
<ejbjar descriptordir="${dd.dir}" srcdir="${build.classes.server}">
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*-weblogic-ejb-jar.xml"/>
<support dir="${build.classes.server}">
<include name="**/*.class"/>
</support>
<weblogic destdir="${deployment.dir}"
keepgeneric="true"
suffix=".jar"
rebuild="false">
<classpath>
<pathelement path="${build.classes.server}"/>
</classpath>
<wlclasspath>
<pathelement path="${weblogic.classes}"/>
</wlclasspath>
</weblogic>
</ejbjar>
Like the WebLogic element, a naming convention for the EJB descriptors is most commonly used to specify the name for the completed JAR file. For example, if the EJB descriptor ejb/Account-ejb-jar.xml is found in the descriptor directory, the iplanet element will search for an EJB descriptor specific to iPlanet Application Server file named ejb/Account-ias-ejb-jar.xml (if it isn't found, the task will fail) and a JAR file named ejb/Account.jar will be written in the destination directory. Note that when the EJB descriptors are added to the JAR file, they are automatically renamed META-INF/ejb-jar.xml and META-INF/ias-ejb-jar.xml.
Of course, this naming behavior can be modified by specifying attributes in the ejbjar task (for example, basejarname, basenameterminator, and flatdestdir) as well as the iplanet element (for example, suffix). Refer to the appropriate documentation for more details.
The <iplanet> nested element parses the EJB deployment descriptor specific to iPlanet Application Server to determine if the bean requires one or more CMP descriptors. These descriptors are specified using the <properties-file-location> element--the value of this element specifies where the CMP descriptor must be placed in the completed EJB JAR file. If any are found, the <iplanet> element will search for the CMP descriptors in the same directory as the standard EJB descriptor and will automatically add the file to the EJB JAR.
| Attribute | Description | Required |
| destdir | The base directory into which the generated JAR files will be written. Each JAR file is written in directories which correspond to their location within the "descriptordir" namespace. | Yes |
| classpath | The classpath used when generating EJB stubs and skeletons. If omitted, the classpath specified in the "ejbjar" parent task will be used. If specified, the classpath elements will be prepended to the classpath specified in the parent "ejbjar" task. Note that nested "classpath" elements may also be used. | No |
| keepgenerated | Indicates whether or not the Java source files which are generated by ejbc will be saved or automatically deleted. If "yes", the source files will be retained. If omitted, it defaults to "no". | No |
| debug | Indicates whether or not the ejbc utility should log additional debugging statements to the standard output. If "yes", the additional debugging statements will be generated. If omitted, it defaults to "no". | No |
| iashome | May be used to specify the "home" directory for this iPlanet Application Server installation. This is used to find the ejbc utility if it isn't included in the user's system path. If specified, it should refer to the [install-location]/iplanet/ias6/ias directory. If omitted, the ejbc utility must be on the user's system path. | No |
| suffix | String value appended to the JAR filename when creating each JAR. If omitted, it defaults to ".jar". | No |
As noted above, the iplanet element supports additional <classpath> nested elements.
<ejbjar srcdir="${build.classesdir}"
descriptordir="${src}" >
<iplanet destdir="${assemble.ejbjar}"
classpath="${ias.ejbc.cpath}" />
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*ias-*.xml"/>
</ejbjar>
This example demonstrates the use of a nested classpath element as well
as some of the other optional attributes.
<ejbjar srcdir="${build.classesdir}"
descriptordir="${src}" >
<iplanet destdir="${assemble.ejbjar}"
iashome="${ias.home}"
debug="yes"
keepgenerated="yes" >
<classpath>
<pathelement path="." />
<pathelement path="${build.classpath}" />
</classpath>
</iplanet>
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*ias-*.xml"/>
</ejbjar>
This example demonstrates the use of basejarname attribute. In this
case, the completed EJB-JAR will be named "HelloWorld.jar" If multiple
EJB descriptors might be found, care must be taken to ensure that the completed
JAR files don't overwrite each other.
<ejbjar srcdir="${build.classesdir}"
descriptordir="${src}"
basejarname="HelloWorld" >
<iplanet destdir="${assemble.ejbjar}"
classpath="${ias.ejbc.cpath}"/>
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*ias-*.xml"/>
</ejbjar>
This example demonstrates the use of the dtd nested element. If the
[iPlanet-install-directory]/APPS directory is included in the classpath,
these local DTDs will be automatically referenced even without the
nested elements.
<ejbjar srcdir="${build.classesdir}"
descriptordir="${src}" >
<iplanet destdir="${assemble.ejbjar}" >
classpath="${ias.ejbc.cpath}" />
<include name="**/*-ejb-jar.xml"/>
<exclude name="**/*ias-*.xml"/>
<dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
location="${ias.home}/APPS/ejb-jar_1_1.dtd"/>
<dtd publicId="-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN"
location="${ias.home}/APPS/IASEjb_jar_1_0.dtd"/>
</ejbjar>