diff --git a/docs/manual/OptionalTasks/ejb.html b/docs/manual/OptionalTasks/ejb.html index a2ec806c8..c3c0ee7cf 100644 --- a/docs/manual/OptionalTasks/ejb.html +++ b/docs/manual/OptionalTasks/ejb.html @@ -13,6 +13,7 @@
Ant provides a number of optional tasks for developing -Enterprise Java Beans (EJBs). +
Ant provides a number of optional tasks for developing +Enterprise Java Beans (EJBs). In general these tasks are specific to the particular vendor's EJB Server.
At present the tasks support:
@@ -48,7 +49,8 @@ In general these tasks are specific to the particular vendor's EJB Server.
ddcreator will compile a set of Weblogic text-based deployment descriptors into a serialized EJB deployment descriptor. The selection of which of the text-based descriptors are to be compiled -is based on the standard Ant include and exclude selection mechanisms. +is based on the standard Ant include and exclude selection mechanisms.
weblogic.ejb.utils.DDCreator
class<ddcreator descriptors="${dd.dir}" - dest="${gen.classes}" +<ddcreator descriptors="${dd.dir}" + dest="${gen.classes}" classpath="${descriptorbuild.classpath}"> <include name="*.txt" /> </ddcreator> @@ -115,19 +118,19 @@ is based on the standard Ant include and exclude selection mechanisms.
ejbc
Description:
-The ejbc task will run Weblogic's ejbc tool. This tool will take a serialised deployment descriptor, -examine the various EJB interfaces and bean classes and then generate the required support classes +
The ejbc task will run Weblogic's ejbc tool. This tool will take a serialised deployment descriptor, +examine the various EJB interfaces and bean classes and then generate the required support classes necessary to deploy the bean in a Weblogic EJB container. This will include the RMI stubs and skeletons as well as the classes which implement the bean's home and remote interfaces.
-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 +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
andexclude
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 +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.
@@ -169,9 +172,9 @@ or are out of date, the ejbc tool is run to generate new versions.Examples
<ejbc descriptors="${gen.classes}" - src="${src.dir}" + src="${src.dir}" dest="${gen.classes}" - manifest="${build.manifest}" + manifest="${build.manifest}" classpath="${descriptorbuild.classpath}"> <include name="*.ser" /> </ejbc> @@ -199,7 +202,7 @@ are out of date will the iAS ejbc utility be called to generate new stubs and skeletons.Parameters:
- +
Attribute | @@ -284,12 +287,12 @@ Examples|||||
home | -The location of the weblogic home that is to be used. This is the location + | 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 + | Yes. Note this is the absolute location, not relative to BEA home. |
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 + | 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 | @@ -364,14 +367,14 @@ and hence ant, will not complete until the weblogic instance is stopped.|
name | -The name of the weblogic server within the weblogic home which is to be run. + | 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 + | 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 | @@ -391,7 +394,7 @@ and hence ant, will not complete until the weblogic instance is stopped.||
pkPassword | -The private key password so the server can decrypt the SSL + | The private key password so the server can decrypt the SSL private key file | N/A | No | @@ -413,7 +416,7 @@ and hence ant, will not complete until the weblogic instance is stopped.|
classpath | -The classpath to be used with the Java Virtual Machine that runs the Weblogic + | The classpath to be used with the Java Virtual Machine that runs the Weblogic Shutdown comment. | Yes | ||
url | -The URL which describes the port to which the server is listening for T3 connections. + | The URL which describes the port to which the server is listening for T3 connections. For example, t3://localhost:7001 | Yes | ||
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' + | 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 + | The base directory containing the .class files that + make up the bean. Included are the home- remote- pk- + and implementation- classes and all classes, that these + depend on. 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 + | 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 + 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 | @@ -667,33 +678,33 @@ beans in the jar.||
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 + | 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 + | 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 + 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 + 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 + | 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 + tool elements will also support a classpath which + will be combined with this classpath when resolving classes | No. | @@ -718,26 +729,26 @@ beans in the jar.
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 + 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 + | 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 + | 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 + | 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 + 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. + 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 + 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 + | 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
+ files. This could be set, for example, to Jikes to
compile with the Jikes compiler. If this is not set
and the build.compiler property is set
to jikes, the Jikes compiler will be used. If this
- is not desired, the value "default "
+ is not desired, the value "default "
may be given to use the default compiler |
No |
rebuild | -This flag controls whether weblogic.ejbc is always + | 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. + 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 + files used to build the class files added to the jar. This can be useful when debugging | No, defaults to false. | @@ -943,9 +954,9 @@ define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.|
weblogicdtd | -Deprecated. Defines the location of the ejb-jar DTD in + | 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 + 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. @@ -954,19 +965,19 @@ define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml. | |
wldtd | -Deprecated. Defines the location of the weblogic-ejb-jar + | 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> + 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 + | 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 + have weblogic in your classpath. If you do not, you should use a nested <dtd> element, described above. | No. | @@ -990,7 +1001,7 @@ define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.
The weblogic nested element itself supports two nested elements <classpath> and +
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.
@@ -1008,7 +1019,7 @@ additional attributesThis example shows ejbjar being used to generate deployment jars using a -Weblogic EJB container. This example requires the naming standard to be used for -the deployment descriptors. Using this format will create a ejb jar file for -each variation of '*-ejb-jar.xml' that is found in the deployment descriptor +
This example shows ejbjar being used to generate deployment jars using a +Weblogic EJB container. This example requires the naming standard to be used for +the deployment descriptors. Using this format will create a ejb jar file for +each variation of '*-ejb-jar.xml' that is found in the deployment descriptor directory.
@@ -1039,13 +1050,13 @@ directory. </ejbjar>-
If weblogic is not in the Ant classpath, the following example -shows how to specify the location of the weblogic DTDs. This +
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}" + <weblogic destdir="${deployment.webshop.dir}" keepgeneric="true" args="-g -keepgenerated ${ejbc.compiler}" suffix=".jar" @@ -1054,18 +1065,18 @@ example also show the use of a nested classpath element. <pathelement path="${descriptorbuild.classpath}"/> </classpath> </weblogic> - <include name="**/*-ejb-jar.xml"/> + <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 +
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'.
@@ -1081,7 +1092,7 @@ descriptors to use the naming standard. This will create only one ejb jar file - </ejbjar> -This example shows ejbjar being used to generate deployment jars for a TOPLink-enabled entity bean using a +
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'.
@@ -1101,17 +1112,17 @@ This will create only one TOPLink-enabled ejb jar file - 'Address.jar'. </ejbjar> -This final example shows how you would set-up ejbjar under Weblogic 6.0. It also shows the use of the +
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"/> + <include name="**/*-ejb-jar.xml"/> <exclude name="**/*-weblogic-ejb-jar.xml"/> <support dir="${build.classes.server}"> - <include name="**/*.class"/> + <include name="**/*.class"/> </support> - <weblogic destdir="${deployment.dir}" + <weblogic destdir="${deployment.dir}" keepgeneric="true" suffix=".jar" rebuild="false"> @@ -1126,6 +1137,140 @@ This will create only one TOPLink-enabled ejb jar file - 'Address.jar'.+
The websphere element searches for the websphere specific deployment descriptors and +adds them to the final ejb jar file. Websphere has two specific desriptors for session +beans: +
deployment
.
+This step can be performed by the websphere element as part of the jar generation process. If the
+switch ejbdeploy
is on, the ejbdeploy tool from the websphere toolset is called for
+every ejb-jar. Unfortunately, this step only works, if you use the ibm jdk. Otherwise, the rmic
+(called by ejbdeploy) throws a ClassFormatError. Be sure to switch ejbdeploy off, if run ant with
+sun jdk.
+
+
++For the websphere element to work, you have to provide a complete classpath, that contains all +classes, that are required to reflect the bean classes. For ejbdeploy to work, you must also provide +the classpath of the ejbdeploy tool (look at the examples below). +
+ +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 | +
ejbdeploy | +Decides wether ejbdeploy is called. When you set this to true, + be sure, to run ant with the ibm jdk. | +No, defaults to true | +
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'. | +
keepgeneric | +This controls whether the generic file used as input to + ejbdeploy is retained. | +No, defaults to false | +
alwaysrebuild | +This controls whether ejbdeploy is called although no changes + have occured. | +No, defaults to false | +
tempdir | +A directory, where ejbdeploy will write temporary files | +No, defaults to '_ejbdeploy_temp'. | +
dbName dbSchema |
+ These options are passed to ejbdeploy. | +No | +
dbVendor | +This option is passed to ejbdeploy. Valid options are for example:
+
|
+ No | +
codegen quiet novalidate noinform trace + use35MappingRules |
+ These options are all passed to ejbdeploy. All options + except 'quiet' default to false. | +No | +
rmicOptions | +This option is passed to ejbdeploy and will be passed + on to rmic. | +No | +
This example shows ejbjar being used to generate deployment jars for all deployment descriptors +in the descriptor dir:
+ ++ <ejbjar srcdir="${build.class}" descriptordir="etc/ejb"> + <include name="*-ejb-jar.xml"/> + <websphere dbvendor="DB2UDBOS390_V6" + ejbdeploy="true" + oldCMP="false" + tempdir="/tmp" + destdir="${dist.server}"> + <wasclasspath> + <pathelement location="${was4.home}/deploytool/itp/plugins/org.eclipse.core.boot/boot.jar"/> + <pathelement location="${was4.home}/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime/batch.jar"/> + <pathelement location="${was4.home}/lib/xerces.jar"/> + <pathelement location="${was4.home}/lib/ivjejb35.jar"/> + <pathelement location="${was4.home}/lib/j2ee.jar"/> + <pathelement location="${was4.home}/lib/vaprt.jar"/> + </wasclasspath> + <classpath> + <path refid="build.classpath"/> + </classpath> + </websphere> + <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" + location="${lib}/dtd/ejb-jar_1_1.dtd"/> + </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. +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 iAS-specific EJB descriptor file named ejb/Account-ias-ejb-jar.xml (if it isn't found, @@ -1171,7 +1316,7 @@ their location within the "descriptordir" namespace.
<ejbjar srcdir="${build.classesdir}" - descriptordir="${src}"> + descriptordir="${src}"> <iplanet destdir="${assemble.ejbjar}"> classpath="${ias.ejbc.cpath}" /> <include name="**/*-ejb-jar.xml"/> @@ -1285,25 +1430,25 @@ local DTDs are found in the [iAS-install-directory]/dtd directory.JOnAS (Java Open Application Server) element
-The <jonas> nested element is used to build JOnAS-specific stubs -and skeletons thanks to the GenIC specific tool, and construct a JAR file -which may be deployed to the JOnAS Application Server. The build process -will always determine if the EJB stubs/skeletons and the EJB-JAR file are +
The <jonas> nested element is used to build JOnAS-specific stubs +and skeletons thanks to the GenIC specific tool, and construct a JAR file +which may be deployed to the JOnAS Application Server. The build process +will always determine if the EJB stubs/skeletons and the EJB-JAR file are up to date, and it will do the minimum amount of work required.
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.xml (or ejb/Account-ejb-jar.xml ) + example, if the EJB descriptor ejb/Account.xml (or ejb/Account-ejb-jar.xml ) is found in the descriptor directory, the jonas element will search for a - JOnAS-specific EJB descriptor file named ejb/Account-jonas-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 + JOnAS-specific EJB descriptor file named ejb/Account-jonas-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/jonas-ejb-jar.xml.
- But if you prefer, you can use JOnAS convention naming and keep your - XML file name : ejb/Account.xml and ejb/jonas-Account.xml, a JAR file named - ejb/Account.jar will be written in the destination directory. - + But if you prefer, you can use JOnAS convention naming and keep your + XML file name : ejb/Account.xml and ejb/jonas-Account.xml, a JAR file named + ejb/Account.jar will be written in the destination directory. +Of course, this naming behavior can be modified by specifying attributes in the ejbjar task (for example, basejarname, basenameterminator, and flatdestdir) @@ -1358,14 +1503,14 @@ If omitted, it defaults to a temporary directory.
No-
Copyright © 2001 Apache Software Foundation. All rights +
Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.