You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ejb.html 69 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>EJB Tasks</title>
  20. </head>
  21. <body>
  22. <h1>Apache Ant EJB Tasks User Manual</h1>
  23. <p>by</p>
  24. <!-- Names are in alphabetical order, on last name -->
  25. <ul>
  26. <li>Paul Austin (<a href="mailto:p_d_austin@yahoo.com">p_d_austin@yahoo.com</a>)</li>
  27. <li>Holger Engels (<a href="mailto:hengels@innovidata.com">hengels@innovidata.com</a>)</li>
  28. <li>Tim Fennell (<a href="mailto:tfenne@rcn.com">tfenne@rcn.com</a>)</li>
  29. <li>Martin Gee (<a href="mailto:martin.gee@icsynergy.com">martin.gee@icsynergy.com</a>)</li>
  30. <li>Conor MacNeill</li>
  31. <li>Cyrille Morvan (<a href="mailto:cmorvan@ingenosya.com">cmorvan@ingenosya.com</a>)</li>
  32. <li>Greg Nelson (<a href="mailto:gn@sun.com">gn@sun.com</a>)</li>
  33. <li>Rob van Oostrum (<a href="mailto:rob@springwellfarms.ca">rob@springwellfarms.ca</a>)</li>
  34. </ul>
  35. <hr/>
  36. <h2>Table of Contents</h2>
  37. <ul>
  38. <li><a href="#introduction">Introduction</a></li>
  39. <li><a href="#ejbtasks">EJB Tasks</a></li>
  40. </ul>
  41. <hr/>
  42. <h2 id="introduction">Introduction</h2>
  43. <p>Ant provides a number of optional tasks for developing 1.x and
  44. 2.x <a href="https://www.oracle.com/technetwork/java/index-jsp-140203.html" target="_top">Enterprise
  45. Java Beans (EJBs)</a>. In general these tasks are specific to the particular vendor's EJB
  46. Server.</p>
  47. <p>The tasks support:</p>
  48. <ul>
  49. <li><a href="http://www.borland.com">Borland</a>Application Server 4.5</li>
  50. <li><a href="https://web.archive.org/web/20020202082841/http://www.iplanet.com:80/products/iplanet_application/home_ias.html">iPlanet</a>Application Server 6.0</li>
  51. <li><a href="https://www.jboss.org/" target="_top">JBoss 2.1</a> and above EJB servers</li>
  52. <li><a href="https://web.archive.org/web/20080516210506/http://www.ironflare.com/">Orion Application Server</a> 2.0 (<em>since Ant 1.10.2</em>)</li>
  53. <li><a href="http://www.bea.com" target="_top">WebLogic</a> 4.5.1 through to 7.0 EJB servers</li>
  54. <li><a href="https://jonas.ow2.org/" target="_top">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li>
  55. <li><a href="https://www.ibm.com/websphere">IBM WebSphere</a> 4.0</li>
  56. </ul>
  57. <p>Vendors such as BEA and IBM now provide custom Ant tasks to work with their particular
  58. products. More importantly, EJB 3.0 renders this whole process obsolete. Accordingly, development
  59. of these tasks is effectively frozen. Bug reports and especially patches are welcome, but there is
  60. no pressing need to add support for new application servers. Nobody should be writing new EJB 2.x
  61. applications and definitely not new EJB 2.x servers.</p>
  62. <hr/>
  63. <h2 id="ejbtasks">EJB Tasks</h2>
  64. <table>
  65. <tr><th>Task</th><th colspan="2">Application Servers</th></tr>
  66. <tr><td><a href="BorlandGenerateClient.html">blgenclient</a></td><td colspan="2">Borland Application Server 4.5 and 5.x</td></tr>
  67. <tr><td><a href="#iplanet-ejbc">iplanet-ejbc</a></td><td colspan="2">iPlanet Application Server 6.0</td></tr>
  68. <tr><td rowspan="8"><a href="#ejbjar">ejbjar</a></td><th colspan="2">Nested Elements</th></tr>
  69. <tr><td><a href="BorlandEJBTasks.html">borland</a></td><td>Borland Application Server 4.5 and 5.x</td></tr>
  70. <tr><td><a href="#ejbjar_iplanet">iPlanet</a></td><td>iPlanet Application Server 6.0</td></tr>
  71. <tr><td><a href="#ejbjar_jboss">jboss</a></td><td>JBoss</td></tr>
  72. <tr><td><a href="#ejbjar_jonas">jonas</a></td><td>JOnAS 2.4.x and 2.5</td></tr>
  73. <tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>WebLogic 5.1 to 7.0</td></tr>
  74. <tr><td><a href="#ejbjar_websphere">websphere</a></td><td>IBM WebSphere 4.0</td></tr>
  75. <tr><td><a href="#ejbjar_orion">orion</a></td><td>IronFlare (Oracle) Orion Application Server 2.0.6</td></tr>
  76. </table>
  77. <hr/>
  78. <h2 id="ddcreator">ddcreator</h2>
  79. <h3>Description</h3>
  80. <p><code>ddcreator</code> will compile a set of WebLogic text-based deployment descriptors into a
  81. serialized EJB deployment descriptor. The selection of which of the text-based descriptors are to be
  82. compiled is based on the standard Ant <code>include</code> and <code>exclude</code> selection
  83. mechanisms.</p>
  84. <h3>Parameters</h3>
  85. <table class="attr">
  86. <tr>
  87. <th>Attribute</th>
  88. <th>Description</th>
  89. <th>Required</th>
  90. </tr>
  91. <tr>
  92. <td>descriptors</td>
  93. <td>This is the base directory from which descriptors are selected.</td>
  94. <td>Yes</td>
  95. </tr>
  96. <tr>
  97. <td>dest</td>
  98. <td>The directory where the serialized deployment descriptors will be written</td>
  99. <td>Yes</td>
  100. </tr>
  101. <tr>
  102. <td>classpath</td>
  103. <td>This is the classpath to use to run the underlying WebLogic <code>ddcreator</code> tool.
  104. This must include the <code>weblogic.ejb.utils.DDCreator</code> class</td>
  105. <td>No</td>
  106. </tr>
  107. </table>
  108. <h3>Examples</h3>
  109. <pre>
  110. &lt;ddcreator descriptors=&quot;${dd.dir}&quot;
  111. dest=&quot;${gen.classes}&quot;
  112. classpath=&quot;${descriptorbuild.classpath}&quot;&gt;
  113. &lt;include name=&quot;*.txt&quot;/&gt;
  114. &lt;/ddcreator&gt;</pre>
  115. <hr/>
  116. <h2 id="ejbc">ejbc</h2>
  117. <h3>Description</h3>
  118. <p>The <code>ejbc</code> task will run WebLogic's <code>ejbc</code> tool. This tool will take a
  119. serialized deployment descriptor, examine the various EJB interfaces and bean classes and then
  120. generate the required support classes necessary to deploy the bean in a WebLogic EJB container. This
  121. will include the RMI stubs and skeletons as well as the classes which implement the bean's home and
  122. remote interfaces.</p>
  123. <p>The Ant task which runs this tool is able to compile several beans in a single operation. The
  124. beans to be compiled are selected by including their serialized deployment descriptors. The standard
  125. Ant <code>include</code> and <code>exclude</code> constructs can be used to select the deployment
  126. descriptors to be included.</p>
  127. <p>Each descriptor is examined to determine whether the generated classes are out of date and need
  128. to be regenerated. The deployment descriptor is de-serialized to discover the home, remote and
  129. implementation classes. The corresponding source files are determined and checked to see their
  130. modification times. These times and the modification time of the serialized descriptor itself are
  131. compared with the modification time of the generated classes. If the generated classes are not
  132. present or are out of date, the <code>ejbc</code> tool is run to generate new versions.</p>
  133. <h3>Parameters</h3>
  134. <table class="attr">
  135. <tr>
  136. <th>Attribute</th>
  137. <th>Description</th>
  138. <th>Required</th>
  139. </tr>
  140. <tr>
  141. <td>descriptors</td>
  142. <td>This is the base directory from which the serialized deployment descriptors are
  143. selected.</td>
  144. <td>Yes</td>
  145. </tr>
  146. <tr>
  147. <td>dest</td>
  148. <td>The base directory where the generated classes, RIM stubs and RMI skeletons are written</td>
  149. <td>Yes</td>
  150. </tr>
  151. <tr>
  152. <td>manifest</td>
  153. <td>The name of a manifest file to be written. This manifest will contain an entry for each EJB
  154. processed</td>
  155. <td>Yes</td>
  156. </tr>
  157. <tr>
  158. <td>src</td>
  159. <td>The base directory of the source tree containing the source files of the home interface,
  160. remote interface and bean implementation classes.</td>
  161. <td>Yes</td>
  162. </tr>
  163. <tr>
  164. <td>classpath</td>
  165. <td>This classpath must include both the <code>weblogic.ejbc</code> class and the class files of
  166. the bean, home interface, remote interface, etc of the bean being processed.</td>
  167. <td>No</td>
  168. </tr>
  169. <tr>
  170. <td>keepgenerated</td>
  171. <td>Controls whether <code>ejbc</code> will keep the intermediate java files used to build the
  172. class files. This can be useful when debugging.</td>
  173. <td>No; defaults to <q>false</q></td>
  174. </tr>
  175. </table>
  176. <h3>Examples</h3>
  177. <pre>
  178. &lt;ejbc descriptors=&quot;${gen.classes}&quot;
  179. src=&quot;${src.dir}&quot;
  180. dest=&quot;${gen.classes}&quot;
  181. manifest=&quot;${build.manifest}&quot;
  182. classpath=&quot;${descriptorbuild.classpath}&quot;&gt;
  183. &lt;include name=&quot;*.ser&quot;/&gt;
  184. &lt;/ejbc&gt;</pre>
  185. <hr/>
  186. <h2 id="iplanet-ejbc">iplanet-ejbc</h2>
  187. <h3>Description</h3>
  188. <p>Task to compile EJB stubs and skeletons for the iPlanet Application Server 6.0. Given a standard
  189. EJB 1.1 XML descriptor as well as an iAS-specific EJB descriptor, this task will generate the stubs
  190. and skeletons required to deploy the EJB to iAS. Since the XML descriptors can include multiple
  191. EJBs, this is a convenient way of specifying many EJBs in a single Ant task.</p>
  192. <p>For each EJB specified, the task will locate the three classes that comprise the EJB in the
  193. destination directory. If these class files cannot be located in the destination directory, the
  194. task will fail. The task will also attempt to locate the EJB stubs and skeletons in this directory.
  195. If found, the timestamps on the stubs and skeletons will be checked to ensure they are up to
  196. date. Only if these files cannot be found or if they are out of date will the iAS <code>ejbc</code>
  197. utility be called to generate new stubs and skeletons.</p>
  198. <h3>Parameters</h3>
  199. <table class="attr">
  200. <tr>
  201. <th>Attribute</th>
  202. <th>Description</th>
  203. <th>Required</th>
  204. </tr>
  205. <tr>
  206. <td>ejbdescriptor</td>
  207. <td>Standard EJB 1.1 XML descriptor (typically titled <q>ejb-jar.xml</q>).</td>
  208. <td>Yes</td>
  209. </tr>
  210. <tr>
  211. <td>iasdescriptor</td>
  212. <td>iAS-specific EJB XML descriptor (typically titled <q>ias-ejb-jar.xml</q>).</td>
  213. <td>Yes</td>
  214. </tr>
  215. <tr>
  216. <td>dest</td>
  217. <td>The is the base directory where the RMI stubs and skeletons are written. In addition, the
  218. class files for each bean (home interface, remote interface, and EJB implementation) must be
  219. found in this directory.</td>
  220. <td>Yes</td>
  221. </tr>
  222. <tr>
  223. <td>classpath</td>
  224. <td>The classpath used when generating EJB stubs and skeletons. Nested <code>classpath</code>
  225. elements may also be used.</td>
  226. <td>No; defaults to the classpath specified when Ant was started</td>
  227. </tr>
  228. <tr>
  229. <td>keepgenerated</td>
  230. <td>Indicates whether or not the Java source files which are generated by <code>ejbc</code> will
  231. be saved or automatically deleted. If <q>yes</q>, the source files will be retained.</td>
  232. <td>No; defaults to <q>no</q></td>
  233. </tr>
  234. <tr>
  235. <td>debug</td>
  236. <td>Indicates whether or not the <code>ejbc</code> utility should log additional debugging
  237. statements to the standard output. If <q>yes</q>, the additional debugging statements will be
  238. generated.</td>
  239. <td>No; defaults to <q>no</q></td>
  240. </tr>
  241. <tr>
  242. <td>iashome</td>
  243. <td>May be used to specify the "home" directory for this iAS installation. This is used to find
  244. the <code>ejbc</code> utility if it isn't included in the user's system path. If specified, it
  245. should refer to the <samp>[install-location]/iplanet/ias6/ias</samp> directory.</td>
  246. <td>No; by default the <code>ejbc</code> utility must be on the user's system path</td>
  247. </tr>
  248. </table>
  249. <h3>Examples</h3>
  250. <pre>
  251. &lt;iplanet-ejbc ejbdescriptor="ejb-jar.xml"
  252. iasdescriptor="ias-ejb-jar.xml"
  253. dest="${build.classesdir}"
  254. classpath="${ias.ejbc.cpath}"/&gt;
  255. &lt;iplanet-ejbc ejbdescriptor="ejb-jar.xml"
  256. iasdescriptor="ias-ejb-jar.xml"
  257. dest="${build.classesdir}"
  258. keepgenerated="yes"
  259. debug="yes"
  260. iashome="${ias.home}"&gt;
  261. &lt;classpath&gt;
  262. &lt;pathelement path="."/&gt;
  263. &lt;pathelement path="${build.classpath}"/&gt;
  264. &lt;/classpath&gt;
  265. &lt;/iplanet-ejbc&gt;</pre>
  266. <hr/>
  267. <h2 id="wlrun">wlrun</h2>
  268. <h3>Description</h3>
  269. <p>The <code>wlrun</code> task is used to start a WebLogic server. The task runs a WebLogic instance
  270. in a separate JVM. A number of parameters are used to control the operation of the WebLogic
  271. instance. Note that the task, and hence Ant, will not complete until the WebLogic instance is
  272. stopped.</p>
  273. <h3>Parameters</h3>
  274. <table class="attr">
  275. <tr>
  276. <th>Attribute</th>
  277. <th>Description</th>
  278. <th>Required for 4.5.1 and 5.1</th>
  279. <th>Required for 6.0</th>
  280. </tr>
  281. <tr>
  282. <td>BEAhome</td>
  283. <td>The location of the <var>BEAhome</var> where the server's config is stored. If this
  284. attribute is present, <code>wlrun</code> assumes that the server will be running under
  285. WebLogic 6.0</td>
  286. <td class="center">N/A</td>
  287. <td>Yes</td>
  288. </tr>
  289. <tr>
  290. <td>home</td>
  291. <td>The location of the WebLogic "home" where WebLogic is installed.</td>
  292. <td class="center">Yes</td>
  293. <td>Yes. Note this is the absolute location, not relative to <var>BEAhome</var>.</td>
  294. </tr>
  295. <tr>
  296. <td>Domain</td>
  297. <td>The domain to which the server belongs.</td>
  298. <td class="center">N/A</td>
  299. <td>Yes</td>
  300. </tr>
  301. <tr>
  302. <td>classpath</td>
  303. <td>The classpath to be used with the JVM that runs the WebLogic Server. Prior to WebLogic 6.0,
  304. this is typically set to the WebLogic boot classpath. Under WebLogic 6.0 this should include
  305. all the WebLogic jars</td>
  306. <td colspan="2">Yes</td>
  307. </tr>
  308. <tr>
  309. <td>wlclasspath</td>
  310. <td>The WebLogic classpath used by the WebLogic Server.</td>
  311. <td class="center">No</td>
  312. <td>N/A</td>
  313. </tr>
  314. <tr>
  315. <td>properties</td>
  316. <td>The name of the server's properties file within the WebLogic home directory used to control
  317. the WebLogic instance.</td>
  318. <td class="center">Yes</td>
  319. <td>N/A</td>
  320. </tr>
  321. <tr>
  322. <td>name</td>
  323. <td>The name of the WebLogic server within the WebLogic home which is to be run.</td>
  324. <td colspan="2">No; defaults to <q>myserver</q></td>
  325. </tr>
  326. <tr>
  327. <td>policy</td>
  328. <td>The name of the security policy file within the WebLogic home directory that is to be
  329. used.</td>
  330. <td colspan="2">No; defaults to <q>weblogic.policy</q></td>
  331. </tr>
  332. <tr>
  333. <td>username</td>
  334. <td>The management username used to manage the server</td>
  335. <td class="center">N/A</td>
  336. <td>No</td>
  337. </tr>
  338. <tr>
  339. <td>password</td>
  340. <td>The server's management password</td>
  341. <td class="center">N/A</td>
  342. <td>Yes</td>
  343. </tr>
  344. <tr>
  345. <td>pkPassword</td>
  346. <td>The private key password so the server can decrypt the SSL private key file</td>
  347. <td class="center">N/A</td>
  348. <td>No</td>
  349. </tr>
  350. <tr>
  351. <td>jvmargs</td>
  352. <td>Additional argument string passed to the JVM used to run the WebLogic instance.</td>
  353. <td colspan="2">No</td>
  354. </tr>
  355. <tr>
  356. <td>weblogicMainClass</td>
  357. <td>name of the main class for WebLogic</td>
  358. <td colspan="2">No</td>
  359. </tr>
  360. </table>
  361. <h3>Nested Elements</h3>
  362. <p>The wlrun task supports nested <code>&lt;classpath&gt;</code>
  363. and <code>&lt;wlclasspath&gt;</code> elements to set the respective classpaths.</p>
  364. <h3>Examples</h3>
  365. <p>This example shows the use of <code>wlrun</code> to run a server under WebLogic 5.1</p>
  366. <pre>
  367. &lt;wlrun taskname=&quot;myserver&quot;
  368. classpath=&quot;${weblogic.boot.classpath}&quot;
  369. wlclasspath=&quot;${weblogic.classes}:${code.jars}&quot;
  370. name=&quot;myserver&quot;
  371. home=&quot;${weblogic.home}&quot;
  372. properties=&quot;myserver/myserver.properties&quot;/&gt;
  373. </pre>
  374. <p>This example shows <code>wlrun</code> being used to run the <samp>petstore</samp> server under
  375. WebLogic 6.0</p>
  376. <pre>
  377. &lt;wlrun taskname=&quot;petstore&quot;
  378. classpath=&quot;${weblogic.classes}&quot;
  379. name=&quot;petstoreServer&quot;
  380. domain=&quot;petstore&quot;
  381. home=&quot;${weblogic.home}&quot;
  382. password=&quot;petstorePassword&quot;
  383. beahome=&quot;${bea.home}&quot;/&gt;</pre>
  384. <hr/>
  385. <h2 id="wlstop">wlstop</h2>
  386. <h3>Description</h3>
  387. <p>The <code>wlstop</code> task is used to stop a WebLogic instance which is currently running. To
  388. shut down an instance you must supply both a username and a password. These will be stored in the
  389. clear in the build script used to stop the instance. For security reasons, this task is therefore
  390. only appropriate in a development environment.</p>
  391. <p>This task works for most versions of WebLogic, including 6.0. You need to specify
  392. the <var>BEAHome</var> to have this task work correctly under 6.0</p>
  393. <h3>Parameters</h3>
  394. <table class="attr">
  395. <tr>
  396. <th>Attribute</th>
  397. <th>Description</th>
  398. <th>Required</th>
  399. </tr>
  400. <tr>
  401. <td>BEAHome</td>
  402. <td>This attribute selects WebLogic 6.0 shutdown.</td>
  403. <td>No</td>
  404. </tr>
  405. <tr>
  406. <td>classpath</td>
  407. <td>The classpath to be used with the JVM that runs the WebLogic Shutdown command.</td>
  408. <td>Yes</td>
  409. </tr>
  410. <tr>
  411. <td>user</td>
  412. <td>The username of the account which will be used to shutdown the server</td>
  413. <td>Yes</td>
  414. </tr>
  415. <tr>
  416. <td>password</td>
  417. <td>The password for the account specified in the user parameter.</td>
  418. <td>Yes</td>
  419. </tr>
  420. <tr>
  421. <td>url</td>
  422. <td>The URL which describes the port to which the server is listening for T3 connections. For
  423. example, <samp>t3://localhost:7001</samp></td>
  424. <td>Yes</td>
  425. </tr>
  426. <tr>
  427. <td>delay</td>
  428. <td>The delay in seconds after which the server will stop.</td>
  429. <td>No; default is <q>0</q> (immediate shutdown)</td>
  430. </tr>
  431. </table>
  432. <h3>Nested Element</h3>
  433. <p>The classpath of the <code>wlstop</code> task can be set by a <code>&lt;classpath&gt;</code>
  434. nested element.</p>
  435. <h3>Examples</h3>
  436. <p>This example show the shutdown for a WebLogic 6.0 server</p>
  437. <pre>
  438. &lt;wlstop classpath=&quot;${weblogic.classes}&quot;
  439. user=&quot;system&quot;
  440. url=&quot;t3://localhost:7001&quot;
  441. password=&quot;foobar&quot;
  442. beahome=&quot;${bea.home}&quot;/&gt;</pre>
  443. <hr/>
  444. <h2 id="ejbjar">ejbjar</h2>
  445. <h3>Description</h3>
  446. <p>This task is designed to support building of EJB jar files (EJB 1.1 &amp; 2.0). Support is
  447. currently provided for 'vanilla' EJB jar files&mdash;i.e. those containing only the user generated
  448. class files and the standard deployment descriptor. Nested elements provide support for vendor
  449. specific deployment tools. These currently include:</p>
  450. <ul>
  451. <li>Borland Application Server 4.5</li>
  452. <li>iPlanet Application Server 6.0</li>
  453. <li>JBoss 2.1 and above</li>
  454. <li>WebLogic 5.1/6.0 session/entity beans using the <code>weblogic.ejbc</code> tool</li>
  455. <li>IBM WebSphere 4.0</li>
  456. <li>TOPLink for WebLogic 2.5.1-enabled entity beans</li>
  457. <li><a href="https://jonas.ow2.org/">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li>
  458. <li>IronFlare Orion Application Server 2.0</li>
  459. </ul>
  460. <p>The task works as a directory scanning task, and performs an action for each deployment
  461. descriptor found. As such the <code>includes</code> and <code>excludes</code> should be set to
  462. ensure that all desired EJB descriptors are found, but no application server descriptors are
  463. found. For each descriptor found, <code>ejbjar</code> will parse the deployment descriptor to
  464. determine the necessary class files which implement the bean. These files are assembled along with
  465. the deployment descriptors into a well formed EJB jar file. Any support files which need to be
  466. included in the generated jar can be added with the <code>&lt;support&gt;</code> nested element. For
  467. each class included in the jar, <code>ejbjar</code> will scan for any super classes or super
  468. interfaces. These will be added to the generated jar.</p>
  469. <p>If no nested vendor-specific deployment elements are present, the task will simply generate a
  470. generic EJB jar. Such jars are typically used as the input to vendor-specific deployment tools. For
  471. each nested deployment element, a vendor specific deployment tool is run to generate a jar file
  472. ready for deployment in that vendor's EJB container.</p>
  473. <p>The jar files are only built if they are out of date. Each deployment tool element will examine
  474. its target jar file and determine if it is out of date with respect to the class files and
  475. deployment descriptors that make up the bean. If any of these files are newer than the jar file the
  476. jar will be rebuilt otherwise a message is logged that the jar file is up to date.</p>
  477. <p>The task uses
  478. the <a href="https://commons.apache.org/bcel/">BCEL</a> <a href="../install.html#librarydependencies">library</a>
  479. to extract all dependent classes. This means that, in addition to the classes that are mentioned in
  480. the deployment descriptor, any classes that these depend on are also automatically included in the
  481. jar file.</p>
  482. <h3 id="naming">Naming Convention</h3>
  483. <code>Ejbjar</code> handles the processing of multiple beans, and it uses a set of naming
  484. conventions to determine the name of the generated EJB jars. The naming convention that is used is
  485. controlled by the <var>naming</var> attribute. It supports the following values
  486. <dl>
  487. <dt><q>descriptor</q></dt>
  488. <dd><p>This is the default naming scheme. The name of the generated bean is derived from the name of
  489. the deployment descriptor. For an <samp>Account</samp> bean, for example, the deployment descriptor
  490. would be named <samp>Account-ejb-jar.xml</samp>. Vendor specific descriptors are located using the
  491. same naming convention. The WebLogic bean, for example, would be
  492. named <samp>Account-weblogic-ejb-jar.xml</samp>. Under this arrangement, the deployment descriptors
  493. can be separated from the code implementing the beans, which can be useful when the same bean code
  494. is deployed in separate beans.</p>
  495. <p>This scheme is useful when you are using one bean per EJB jar and where you may be deploying the
  496. same bean classes in different beans, with different deployment characteristics.</p></dd>
  497. <dt><q>ejb-name</q></dt>
  498. <dd><p>This naming scheme uses the <code>&lt;ejb-name&gt;</code> element from the deployment
  499. descriptor to determine the bean name. In this situation, the descriptors normally use the generic
  500. descriptor names, such as <samp>ejb-jar.xml</samp> along with any associated vendor specific
  501. descriptor names. For example, If the value of the <code>&lt;ejb-name&gt;</code> were to be given in
  502. the deployment descriptor as follows:</p>
  503. <pre>
  504. &lt;ejb-jar&gt;
  505. &lt;enterprise-beans&gt;
  506. &lt;entity&gt;
  507. &lt;ejb-name&gt;Sample&lt;/ejb-name&gt;
  508. &lt;home&gt;org.apache.ant.ejbsample.SampleHome&lt;/home&gt;</pre>
  509. <p>then the name of the generated bean would be <samp>Sample.jar</samp></p>
  510. <p>This scheme is useful where you want to use the standard deployment descriptor names, which may
  511. be more compatible with other EJB tools. This scheme must have one bean per jar.</p></dd>
  512. <dt><q>directory</q></dt>
  513. <dd><p>In this mode, the name of the generated bean jar is derived from the directory containing the
  514. deployment descriptors. Again the deployment descriptors typically use the standard filenames. For
  515. example, if the path to the deployment descriptor
  516. is <samp>/home/user/dev/appserver/dd/sample</samp>, then the generated bean will be
  517. named <samp>sample.jar</samp></p>
  518. <p>This scheme is also useful when you want to use standard style descriptor names. It is often most
  519. useful when the descriptors are located in the same directory as the bean source code, although that
  520. is not mandatory. This scheme can handle multiple beans per jar.</p></dd>
  521. <dt><q>basejarname</q></dt>
  522. <dd><p>The final scheme supported by the <code>&lt;ejbjar&gt;</code> task is used when you want to
  523. specify the generated bean jar name directly. In this case the name of the generated jar is
  524. specified by the <var>basejarname</var> attribute. Since all generated beans will have the same
  525. name, this task should be only used when each descriptor is in its own directory.</p>
  526. <p>This scheme is most appropriate when you are using multiple beans per jar and only process a
  527. single deployment descriptor. You typically want to specify the name of the jar and not derive it
  528. from the beans in the jar.</p></dd>
  529. </dl>
  530. <h3 id="ejbjar_deps">Dependencies</h3>
  531. <p>In addition to the bean classes, <code>ejbjar</code> is able to ad additional classes to the
  532. generated EJB jar. These classes are typically the support classes which are used by the bean's
  533. classes or as parameters to the bean's methods.</p>
  534. <p>In versions of Ant prior to 1.5, <code>ejbjar</code> used reflection and attempted to add the
  535. super classes and super interfaces of the bean classes. For this technique to work the bean classes
  536. had to be loaded into Ant's JVM. This was not always possible due to class dependencies.</p>
  537. <p><em>Since Ant 1.5</em> the task uses the <a href="https://commons.apache.org/bcel/">BCEL</a>
  538. library to analyze the bean's class files directly, rather than loading them into the JVM. This also
  539. allows <code>ejbjar</code> to add all of the required support classes for a bean and not just super
  540. classes.</p>
  541. <p><em>Since Ant 1.5</em>, a <var>dependency</var> attribute allows the buildfile to control what
  542. additional classes are added to the generated jar. It takes three possible values</p>
  543. <ul>
  544. <li><q>none</q>&mdash;only the bean classes and interfaces described in the bean's descriptor are
  545. added to the jar.</li>
  546. <li><q>super</q>&mdash;this is the default value and replicates the original <code>ejbjar</code>
  547. behaviour where super classes and super interfaces are added to the jar</li>
  548. <li><q>full</q>&mdash;In this mode all classes used by the bean's classes and interfaces are added
  549. to the jar</li>
  550. </ul>
  551. <p>The <q>super</q> and <q>full</q> values require
  552. the <a href="https://commons.apache.org/bcel/">BCEL</a> library to be available. If it is
  553. not, <code>ejbjar</code> will drop back to the behaviour corresponding to the value <q>none</q>.</p>
  554. <h3>Parameters</h3>
  555. <table class="attr">
  556. <tr>
  557. <th>Attribute</th>
  558. <th>Description</th>
  559. <th>Required</th>
  560. </tr>
  561. <tr>
  562. <td>descriptordir</td>
  563. <td>The base directory under which to scan for EJB deployment descriptors. If this attribute is
  564. not specified, then the deployment descriptors must be located in the directory specified by
  565. the <var>srcdir</var> attribute.</td>
  566. <td>No</td>
  567. </tr>
  568. <tr>
  569. <td>srcdir</td>
  570. <td>The base directory containing the .class files that make up the bean. Included are
  571. the <samp>home-</samp>, <samp>remote-</samp>, <samp>pk-</samp>
  572. and <samp>implementation-</samp> classes and all classes that these depend on. Note that this
  573. can be the same as the <var>descriptordir</var> if all files are in the same directory
  574. tree.</td>
  575. <td>Yes</td>
  576. </tr>
  577. <tr>
  578. <td>destdir</td>
  579. <td>The base directory into which generated jar files are deposited. Jar files are deposited in
  580. directories corresponding to their location within the <var>descriptordir</var>
  581. namespace. Note that this attribute is only used if the task is generating generic jars
  582. (i.e. no vendor-specific deployment elements have been specified).</td>
  583. <td>Yes, unless vendor-specific deployment elements have been specified.</td>
  584. </tr>
  585. <tr>
  586. <td>cmpversion</td>
  587. <td>Either <q>1.0</q> or <q>2.0</q>.<br/>A CMP 2.0 implementation exists currently only for
  588. JBoss.</td>
  589. <td>No; default is <q>1.0</q></td>
  590. </tr>
  591. <tr>
  592. <td>naming</td>
  593. <td>Controls the naming convention used to name generated EJB jars. Please refer to the
  594. description <a href="#naming">above</a>.</td>
  595. <td>No</td>
  596. </tr>
  597. <tr>
  598. <td>basejarname</td>
  599. <td>The base name that is used for the generated jar files. If this attribute is specified, the
  600. generic jar file name will use this value as the prefix (followed by the value specified in
  601. the <var>genericjarsuffix</var> attribute) and the resultant EJB jar file (followed by any
  602. suffix specified in the nested element).</td>
  603. <td>No</td>
  604. </tr>
  605. <tr>
  606. <td>basenameterminator</td>
  607. <td>String value used to substring out a string from the name of each deployment descriptor
  608. found, which is then used to locate related deployment descriptors (e.g. the WebLogic
  609. descriptors). For example, a basename of <q>.</q> and a deployment descriptor
  610. called <samp>FooBean.ejb-jar.xml</samp> would result in a basename of <q>FooBean</q> which
  611. would then be used to find <samp>FooBean.weblogic-ejb-jar.xml</samp>
  612. and <samp>FooBean.weblogic-cmp-rdbms-jar.xml</samp>, as well as to create the filenames of the
  613. jar files as <samp>FooBean-generic.jar</samp> and <samp>FooBean-wl.jar</samp>. This attribute
  614. is not used if the <var>basejarname</var> attribute is specified.</td>
  615. <td>No; defaults to <q>-</q></td>
  616. </tr>
  617. <tr>
  618. <td>genericjarsuffix</td>
  619. <td>String value appended to the basename of the deployment descriptor to create the filename of
  620. the generic EJB jar file.</td>
  621. <td>No; defaults to <q class="no-break">-generic.jar</q></td>
  622. </tr>
  623. <tr>
  624. <td>classpath</td>
  625. <td>This classpath is used when resolving classes which are to be added to the jar. Typically
  626. nested deployment tool elements will also support a classpath which will be combined with this
  627. classpath when resolving classes</td>
  628. <td>No</td>
  629. </tr>
  630. <tr>
  631. <td>flatdestdir</td>
  632. <td>Set this attribute to <q>true</q> if you want all generated jars to be placed in the root
  633. of the <var>destdir</var>, rather than according to the location of the deployment
  634. descriptor within the <var>descriptordir</var> hierarchy.</td>
  635. <td>No</td>
  636. </tr>
  637. <tr>
  638. <td>dependency</td>
  639. <td>This attribute controls which additional classes and interfaces are added to the jar. Please
  640. refer to the description <a href="#ejbjar_deps">above</a></td>
  641. <td>No</td>
  642. </tr>
  643. <tr>
  644. <td>manifest</td>
  645. <td>the manifest file to use, if any.</td>
  646. <td>No</td>
  647. </tr>
  648. </table>
  649. <h3>Nested Elements</h3>
  650. <p>In addition to the vendor specific nested elements, the <code>ejbjar</code> task provides three
  651. nested elements.</p>
  652. <h4>Classpath</h4>
  653. <p>The <code>&lt;classpath&gt;</code> nested element allows the classpath to be set. It is useful
  654. when setting the classpath from a reference path. In all other respects the behaviour is the same as
  655. the classpath attribute.</p>
  656. <h4 id="ejbjar-dtd">dtd</h4>
  657. <p>The <code>&lt;dtd&gt;</code> element is used to specify the local location of DTDs to be used
  658. when parsing the EJB deployment descriptor. Using a local DTD is much faster than loading the DTD
  659. across the net. If you are running <code>ejbjar</code> behind a firewall you may not even be able to
  660. access the remote DTD. The supported vendor-specific nested elements know the location of the
  661. required DTDs within the vendor class hierarchy and, in general, this means <code>&lt;dtd&gt;</code>
  662. elements are not required. It does mean, however, that the vendor's class hierarchy must be
  663. available in the classpath when Ant is started. If your want to run Ant without requiring the vendor
  664. classes in the classpath, you would need to use a <code>&lt;dtd&gt;</code> element.</p>
  665. <table class="attr">
  666. <tr>
  667. <th>Attribute</th>
  668. <th>Description</th>
  669. <th>Required</th>
  670. </tr>
  671. <tr>
  672. <td>publicId</td>
  673. <td>The public Id of the DTD for which the location is being provided</td>
  674. <td>Yes</td>
  675. </tr>
  676. <tr>
  677. <td>location</td>
  678. <td>The location of the local copy of the DTD. This can either be a file or a resource loadable
  679. from the classpath.</td>
  680. <td>Yes</td>
  681. </tr>
  682. </table>
  683. <h4>support</h4>
  684. <p>The <code>&lt;support&gt;</code> nested element is used to supply additional classes (files) to
  685. be included in the generated jars. The <code>&lt;support&gt;</code> element is
  686. a <a href="../Types/fileset.html">FileSet</a>, so it can either reference a fileset declared
  687. elsewhere or it can be defined in-place with the appropriate <code>&lt;include&gt;</code>
  688. and <code>&lt;exclude&gt;</code> nested elements. The files in the support fileset are added into
  689. the generated EJB jar in the same relative location as their location within the support
  690. fileset. Note that when <code>ejbjar</code> generates more than one jar file, the support files are
  691. added to each one.</p>
  692. <h3>Vendor-specific deployment elements</h3>
  693. <p>Each vendor-specific nested element controls the generation of a deployable jar specific to that
  694. vendor's EJB container. The parameters for each supported deployment element are detailed here.</p>
  695. <h3 id="ejbjar_jboss">Jboss element</h3>
  696. <p>The <code>jboss</code> element searches for the JBoss specific deployment descriptors and adds
  697. them to the final EJB jar file. JBoss has two deployment descriptors:</p>
  698. <ul>
  699. <li><samp>jboss.xml</samp></li>
  700. <li>for container manager persistence:
  701. <table>
  702. <tr><th>CMP version</th><th>File name</th></tr>
  703. <tr><td>CMP 1.0</td><td><samp>jaws.xml</samp></td></tr>
  704. <tr><td>CMP 2.0</td><td><samp>jbosscmp-jdbc.xml</samp></td></tr>
  705. </table>
  706. </li>
  707. </ul>
  708. <p>The JBoss server uses hot deployment and does not require compilation of additional stubs and
  709. skeletons.</p>
  710. <table class="attr">
  711. <tr>
  712. <th>Attribute</th>
  713. <th>Description</th>
  714. <th>Required</th>
  715. </tr>
  716. <tr>
  717. <td>destdir</td>
  718. <td>The base directory into which the generated JBoss ready jar files are deposited. Jar files
  719. are deposited in directories corresponding to their location within
  720. the <var>descriptordir</var> namespace.</td>
  721. <td>Yes</td>
  722. </tr>
  723. <tr>
  724. <td>genericjarsuffix</td>
  725. <td>A generic jar is generated as an intermediate step in build the JBoss deployment jar. The
  726. suffix used to generate the generic jar file is not particularly important unless it is
  727. desired to keep the generic jar file. It should not, however, be the same as the suffix
  728. setting.</td>
  729. <td>No; defaults to <q class="no-break">-generic.jar</q></td>
  730. </tr>
  731. <tr>
  732. <td>suffix</td>
  733. <td>String value appended to the basename of the deployment descriptor to create the filename of
  734. the JBoss EJB jar file.</td>
  735. <td>No; defaults to <q>.jar</q></td>
  736. </tr>
  737. <tr>
  738. <td>keepgeneric</td>
  739. <td>This controls whether the generic file used as input to <code>ejbc</code> is retained.</td>
  740. <td>No; defaults to <q>false</q></td>
  741. </tr>
  742. </table>
  743. <h3 id="ejbjar_weblogic">WebLogic element</h3>
  744. <p>The <code>weblogic</code> element is used to control the <code>weblogic.ejbc</code> compiler for
  745. generating WebLogic EJB jars. Prior to Ant 1.3, the method of locating CMP descriptors was to use
  746. the <code>ejbjar</code> naming convention. So if your EJB jar was
  747. called, <samp>Customer-ejb-jar.xml</samp>, your WebLogic descriptor was
  748. called <samp>Customer-weblogic-ejb-jar.xml</samp> and your CMP descriptor had to
  749. be <samp>Customer-weblogic-cmp-rdbms-jar.xml</samp>. In addition,
  750. the <code>&lt;type-storage&gt;</code> element in the WebLogic descriptor had to be set to the
  751. standard name <samp>META-INF/weblogic-cmp-rdbms-jar.xml</samp>, as that is where the CMP descriptor
  752. was mapped to in the generated jar.</p>
  753. <p>There are a few problems with this scheme. It does not allow for more than one CMP descriptor to
  754. be defined in a jar and it is not compatible with the deployment descriptors generated by some
  755. tools.</p>
  756. <p>In Ant 1.3, <code>ejbjar</code> parses the WebLogic deployment descriptor to discover the CMP
  757. descriptors, which are then included automatically. This behaviour is controlled by
  758. the <var>newCMP</var> attribute. Note that if you move to the new method of determining CMP
  759. descriptors, you will need to update your WebLogic deployment
  760. descriptor's <code>&lt;type-storage&gt;</code> element. In the above example, you would define this
  761. as <samp>META-INF/Customer-weblogic-cmp-rdbms-jar.xml</samp>.</p>
  762. <table class="attr">
  763. <tr>
  764. <th>Attribute</th>
  765. <th>Description</th>
  766. <th>Required</th>
  767. </tr>
  768. <tr>
  769. <td>destdir</td>
  770. <td>The base directory into which the generated WebLogic ready jar files are deposited. Jar
  771. files are deposited in directories corresponding to their location within
  772. the <var>descriptordir</var> namespace.</td>
  773. <td>Yes</td>
  774. </tr>
  775. <tr>
  776. <td>genericjarsuffix</td>
  777. <td>A generic jar is generated as an intermediate step in build the WebLogic deployment jar. The
  778. suffix used to generate the generic jar file is not particularly important unless it is
  779. desired to keep the generic jar file. It should not, however, be the same as the suffix
  780. setting.</td>
  781. <td>No; defaults to <q class="no-break">-generic.jar</q></td>
  782. </tr>
  783. <tr>
  784. <td>suffix</td>
  785. <td>String value appended to the basename of the deployment descriptor to create the filename of
  786. the WebLogic EJB jar file.</td>
  787. <td>No; defaults to <q>.jar</q></td>
  788. </tr>
  789. <tr>
  790. <td>classpath</td>
  791. <td>The classpath to be used when running the WebLogic <code>ejbc</code> tool. Note that this
  792. tool typically requires the classes that make up the bean to be available on the classpath.
  793. Currently, however, this will cause the <code>ejbc</code> tool to be run in a separate
  794. JVM</td>
  795. <td>No</td>
  796. </tr>
  797. <tr>
  798. <td>wlclasspath</td>
  799. <td>WebLogic 6.0 will give a warning if the home and remote interfaces of a bean are on the
  800. system classpath used to run <code>weblogic.ejbc</code>. In that case, the standard WebLogic
  801. classes should be set with this attribute (or equivalent nested element) and the home and
  802. remote interfaces located with the standard classpath attribute</td>
  803. <td>No</td>
  804. </tr>
  805. <tr>
  806. <td>keepgeneric</td>
  807. <td>This controls whether the generic file used as input to <code>ejbc</code> is retained.</td>
  808. <td>No; defaults to <q>false</q></td>
  809. </tr>
  810. <tr>
  811. <td>compiler</td>
  812. <td>This allows for the selection of a different compiler to be used for the compilation of the
  813. generated Java files. This could be set, for example, to <q>jikes</q> to compile with the
  814. Jikes compiler. If this is not set and the <code>build.compiler</code> property is set
  815. to <q>jikes</q>, the Jikes compiler will be used. If this is not desired, the
  816. value <q>default</q> may be given to use the default compiler</td>
  817. <td>No</td>
  818. </tr>
  819. <tr>
  820. <td>rebuild</td>
  821. <td>This flag controls whether <code>weblogic.ejbc</code> is always invoked to build the jar
  822. file. In certain circumstances, such as when only a bean class has been changed, the jar can
  823. be generated by merely replacing the changed classes and not
  824. rerunning <code>ejbc</code>. Setting this to <q>false</q> will reduce the time to
  825. run <code>ejbjar</code>.</td>
  826. <td>No; defaults to <q>true</q></td>
  827. </tr>
  828. <tr>
  829. <td>keepgenerated</td>
  830. <td>Controls whether WebLogic will keep the generated Java files used to build the class files
  831. added to the jar. This can be useful when debugging</td>
  832. <td>No; defaults to <q>false</q></td>
  833. </tr>
  834. <tr>
  835. <td>args</td>
  836. <td>Any additional arguments to be passed to the <code>weblogic.ejbc</code> tool.</td>
  837. <td>No</td>
  838. </tr>
  839. <tr>
  840. <td>weblogicdtd</td>
  841. <td><em><u>Deprecated</u></em>. Defines the location of the ejb-jar DTD in the WebLogic class
  842. hierarchy. This should not be necessary if you have WebLogic in your classpath. If you do not,
  843. you should use a nested <code>&lt;dtd&gt;</code> element, described above. If you do choose to
  844. use an attribute, you should use a nested <code>&lt;dtd&gt;</code> element.</td>
  845. <td>No</td>
  846. </tr>
  847. <tr>
  848. <td>wldtd</td>
  849. <td><em><u>Deprecated</u></em>. Defines the location of the weblogic-ejb-jar DTD which covers
  850. the WebLogic specific deployment descriptors. This should not be necessary if you have
  851. WebLogic in your classpath. If you do not, you should use a nested <code>&lt;dtd&gt;</code>
  852. element, described above.</td>
  853. <td>No</td>
  854. </tr>
  855. <tr>
  856. <td>ejbdtd</td>
  857. <td><em><u>Deprecated</u></em>. Defines the location of the ejb-jar DTD in the WebLogic class
  858. hierarchy. This should not be necessary if you have WebLogic in your classpath. If you do not,
  859. you should use a nested <code>&lt;dtd&gt;</code> element, described above.</td>
  860. <td>No</td>
  861. </tr>
  862. <tr>
  863. <td>newCMP</td>
  864. <td>If this is set to <q>true</q>, the new method for locating CMP descriptors will be
  865. used.</td>
  866. <td>No; defaults to <q>false</q></td>
  867. </tr>
  868. <tr>
  869. <td>oldCMP</td>
  870. <td><em><u>Deprecated</u></em> This is an antonym for <var>newCMP</var> which should be used
  871. instead.</td>
  872. <td>No</td>
  873. </tr>
  874. <tr>
  875. <td>noEJBC</td>
  876. <td>If this attribute is set to <q>true</q>, WebLogic's <code>ejbc</code> will not be run on the
  877. EJB jar. Use this if you prefer to run <code>ejbc</code> at deployment time.</td>
  878. <td>No</td>
  879. </tr>
  880. <tr>
  881. <td>ejbcclass</td>
  882. <td>Specifies the classname of the <code>ejbc</code> compiler. Normally <code>ejbjar</code>
  883. determines the appropriate class based on the DTD used for the EJB. The EJB 2.0 compiler
  884. featured in WebLogic 6 has, however, been deprecated in version 7. When using with version 7
  885. this attribute should be set to <q>weblogic.ejbc</q> to avoid the deprecation warning.</td>
  886. <td>No</td>
  887. </tr>
  888. <tr>
  889. <td>jvmargs</td>
  890. <td>Any additional arguments to be passed to the JVM running <code>weblogic.ejbc</code>
  891. tool. For example to set the memory size, this could
  892. be <var>jvmargs</var>=<q>-Xmx128m</q></td>
  893. <td>No</td>
  894. </tr>
  895. <tr>
  896. <td>jvmdebuglevel</td>
  897. <td>Sets the <code>weblogic.StdoutSeverityLevel</code> to use when running the JVM that
  898. executes <code>ejbc</code>. Set to <q>16</q> to avoid the warnings about EJB Home and Remotes
  899. being in the classpath</td>
  900. <td>No</td>
  901. </tr>
  902. <tr>
  903. <td>outputdir</td>
  904. <td>If set <code>ejbc</code> will be given this directory as the output destination rather than
  905. a jar file. This allows for the generation of &quot;exploded&quot; jars.</td>
  906. <td>No</td>
  907. </tr>
  908. </table>
  909. <p>The <code>weblogic</code> nested element supports three nested elements. The first
  910. two, <code>&lt;classpath&gt;</code> and <code>&lt;wlclasspath&gt;</code>, are used to set the
  911. respective classpaths. These nested elements are useful when setting up classpaths using reference
  912. Ids. The last, <code>&lt;sysproperty&gt;</code>, allows Java system properties to be set during the
  913. compiler run. This turns out to be necessary for supporting CMP EJB compilation in all
  914. environments.</p>
  915. <h3>TOPLink for WebLogic element</h3>
  916. <p><em><u>Deprecated</u></em></p>
  917. <p>The <code>toplink</code> element is no longer required. Toplink beans can now be built with the
  918. standard <code>weblogic</code> element, as long as the <var>newCMP</var> attribute is set
  919. to <q>true</q></p>
  920. <p>The <code>TopLink</code> element is used to handle beans which use Toplink for the CMP
  921. operations. It is derived from the standard <code>weblogic</code> element so it supports the same
  922. set of attributes plus these additional attributes</p>
  923. <table class="attr">
  924. <tr>
  925. <th>Attribute</th>
  926. <th>Description</th>
  927. <th>Required</th>
  928. </tr>
  929. <tr>
  930. <td>toplinkdescriptor</td>
  931. <td>This specifies the name of the TOPLink deployment descriptor file contained in
  932. the <var>descriptordir</var> directory.</td>
  933. <td>Yes</td>
  934. </tr>
  935. <tr>
  936. <td>toplinkdtd</td>
  937. <td>This specifies the location of the TOPLink DTD file. This can be a file path or a file
  938. URL. This attribute is not required, but using a local DTD is recommended.</td>
  939. <td>No; defaults to DTD file at <samp>www.objectpeople.com</samp>.</td>
  940. </tr>
  941. </table>
  942. <h3>Examples</h3>
  943. <p>This example shows <code>ejbjar</code> being used to generate deployment jars using a WebLogic
  944. EJB container. This example requires the naming standard to be used for the deployment
  945. descriptors. Using this format will create a EJB jar file for each variation
  946. of <samp>*-ejb-jar.xml</samp> that is found in the deployment descriptor directory.</p>
  947. <pre>
  948. &lt;ejbjar srcdir=&quot;${build.classes}&quot;
  949. descriptordir=&quot;${descriptor.dir}&quot;&gt;
  950. &lt;weblogic destdir=&quot;${deploymentjars.dir}&quot;
  951. classpath=&quot;${descriptorbuild.classpath}&quot;/&gt;
  952. &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
  953. &lt;exclude name=&quot;**/*weblogic*.xml&quot;/&gt;
  954. &lt;/ejbjar&gt;</pre>
  955. <p>If WebLogic is not in the Ant classpath, the following example shows how to specify the location
  956. of the WebLogic DTDs. This example also show the use of a nested <code>classpath</code> element.</p>
  957. <pre>
  958. &lt;ejbjar descriptordir=&quot;${src.dir}&quot; srcdir=&quot;${build.classes}&quot;&gt;
  959. &lt;weblogic destdir=&quot;${deployment.webshop.dir}&quot;
  960. keepgeneric=&quot;true&quot;
  961. args=&quot;-g -keepgenerated ${ejbc.compiler}&quot;
  962. suffix=&quot;.jar&quot;
  963. oldCMP=&quot;false&quot;&gt;
  964. &lt;classpath&gt;
  965. &lt;pathelement path=&quot;${descriptorbuild.classpath}&quot;/&gt;
  966. &lt;/classpath&gt;
  967. &lt;/weblogic&gt;
  968. &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
  969. &lt;exclude name=&quot;**/*-weblogic-ejb-jar.xml&quot;/&gt;
  970. &lt;dtd publicId=&quot;-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN&quot;
  971. location=&quot;${weblogic.home}/classes/weblogic/ejb/deployment/xml/ejb-jar.dtd&quot;/&gt;
  972. &lt;dtd publicId=&quot;-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN&quot;
  973. location=&quot;${weblogic.home}/classes/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd&quot;/&gt;
  974. &lt;/ejbjar&gt;</pre>
  975. <p>This example shows <code>ejbjar</code> being used to generate a single deployment jar using a
  976. WebLogic EJB container. This example does not require the deployment descriptors to use the naming
  977. standard. This will create only one EJB jar file&mdash;<samp>TheEJBJar.jar</samp>.</p>
  978. <pre>
  979. &lt;ejbjar srcdir=&quot;${build.classes}&quot;
  980. descriptordir=&quot;${descriptor.dir}&quot;
  981. basejarname=&quot;TheEJBJar&quot;&gt;
  982. &lt;weblogic destdir=&quot;${deploymentjars.dir}&quot;
  983. classpath=&quot;${descriptorbuild.classpath}&quot;/&gt;
  984. &lt;include name=&quot;**/ejb-jar.xml&quot;/&gt;
  985. &lt;exclude name=&quot;**/weblogic*.xml&quot;/&gt;
  986. &lt;/ejbjar&gt;</pre>
  987. <p>This example shows <code>ejbjar</code> being used to generate deployment jars for a
  988. TOPLink-enabled entity bean using a WebLogic EJB container. This example does not require the
  989. deployment descriptors to use the naming standard. This will create only one TOPLink-enabled EJB
  990. jar file&mdash;<samp>Address.jar</samp>.</p>
  991. <pre>
  992. &lt;ejbjar srcdir=&quot;${build.dir}&quot;
  993. destdir=&quot;${solant.ejb.dir}&quot;
  994. descriptordir=&quot;${descriptor.dir}&quot;
  995. basejarname=&quot;Address&quot;&gt;
  996. &lt;weblogictoplink destdir=&quot;${solant.ejb.dir}&quot;
  997. classpath=&quot;${java.class.path}&quot;
  998. keepgeneric=&quot;false&quot;
  999. toplinkdescriptor=&quot;Address.xml&quot;
  1000. toplinkdtd=&quot;file:///dtdfiles/toplink-cmp_2_5_1.dtd&quot;
  1001. suffix=&quot;.jar&quot;/&gt;
  1002. &lt;include name=&quot;**/ejb-jar.xml&quot;/&gt;
  1003. &lt;exclude name=&quot;**/weblogic-ejb-jar.xml&quot;/&gt;
  1004. &lt;/ejbjar&gt;</pre>
  1005. <p>This final example shows how you would set-up <code>ejbjar</code> under WebLogic 6.0. It also
  1006. shows the use of the <code>&lt;support&gt;</code> element to add support files</p>
  1007. <pre>
  1008. &lt;ejbjar descriptordir=&quot;${dd.dir}&quot; srcdir=&quot;${build.classes.server}&quot;&gt;
  1009. &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
  1010. &lt;exclude name=&quot;**/*-weblogic-ejb-jar.xml&quot;/&gt;
  1011. &lt;support dir=&quot;${build.classes.server}&quot;&gt;
  1012. &lt;include name=&quot;**/*.class&quot;/&gt;
  1013. &lt;/support&gt;
  1014. &lt;weblogic destdir=&quot;${deployment.dir}&quot;
  1015. keepgeneric=&quot;true&quot;
  1016. suffix=&quot;.jar&quot;
  1017. rebuild=&quot;false&quot;&gt;
  1018. &lt;classpath&gt;
  1019. &lt;pathelement path=&quot;${build.classes.server}&quot;/&gt;
  1020. &lt;/classpath&gt;
  1021. &lt;wlclasspath&gt;
  1022. &lt;pathelement path=&quot;${weblogic.classes}&quot;/&gt;
  1023. &lt;/wlclasspath&gt;
  1024. &lt;/weblogic&gt;
  1025. &lt;/ejbjar&gt;</pre>
  1026. <h3 id="ejbjar_websphere">WebSphere element</h3>
  1027. <p>The <code>websphere</code> element searches for the WebSphere specific deployment descriptors and
  1028. adds them to the final EJB jar file. WebSphere has two specific descriptors for session beans:</p>
  1029. <ul>
  1030. <li><samp>ibm-ejb-jar-bnd.xmi</samp></li>
  1031. <li><samp>ibm-ejb-jar-ext.xmi</samp></li>
  1032. </ul>
  1033. <p>and another two for container managed entity beans:</p>
  1034. <ul>
  1035. <li><samp>Map.mapxmi</samp></li>
  1036. <li><samp>Schema.dbxmi</samp></li>
  1037. </ul>
  1038. <p>In terms of WebSphere, the generation of container code and stubs is called <em>deployment</em>.
  1039. This step can be performed by the <code>websphere</code> element as part of the jar generation
  1040. process. If the switch <var>ejbdeploy</var> is on, the <code>ejbdeploy</code> tool from the
  1041. WebSphere toolset is called for every EJB jar. Unfortunately, this step only works, if you use the
  1042. IBM JDK. Otherwise, the <code>rmic</code> (called by <code>ejbdeploy</code>) throws
  1043. a <code>ClassFormatError</code>. Be sure to switch <var>ejbdeploy</var> off, if Ant runs with Oracle
  1044. JDK or OpenJDK.</p>
  1045. <p>For the <code>websphere</code> element to work, you have to provide a complete classpath, that
  1046. contains all classes, that are required to reflect the bean classes. For <code>ejbdeploy</code> to
  1047. work, you must also provide the classpath of the <code>ejbdeploy</code> tool and set
  1048. the <code>websphere.home</code> property (look at the examples below).</p>
  1049. <table class="attr">
  1050. <tr>
  1051. <th>Attribute</th>
  1052. <th>Description</th>
  1053. <th>Required</th>
  1054. </tr>
  1055. <tr>
  1056. <td>destdir</td>
  1057. <td>The base directory into which the generated WebSphere ready jar files are deposited. Jar
  1058. files are deposited in directories corresponding to their location within
  1059. the <var>descriptordir</var> namespace.</td>
  1060. <td>Yes</td>
  1061. </tr>
  1062. <tr>
  1063. <td>ejbdeploy</td>
  1064. <td>Decides whether <code>ejbdeploy</code> is called. When you set this to <q>true</q>, be
  1065. sure, to run Ant with the IBM JDK.</td>
  1066. <td>No; defaults to <q>true</q></td>
  1067. </tr>
  1068. <tr>
  1069. <td>suffix</td>
  1070. <td>String value appended to the basename of the deployment descriptor to create the filename of
  1071. the WebSphere EJB jar file.</td>
  1072. <td>No; defaults to <q>.jar</q></td>
  1073. </tr>
  1074. <tr>
  1075. <td>keepgeneric</td>
  1076. <td>This controls whether the generic file used as input to <code>ejbdeploy</code> is
  1077. retained.</td>
  1078. <td>No; defaults to <q>false</q></td>
  1079. </tr>
  1080. <tr>
  1081. <td>rebuild</td>
  1082. <td>This controls whether <code>ejbdeploy</code> is called although no changes have
  1083. occurred.</td>
  1084. <td>No; defaults to <q>false</q></td>
  1085. </tr>
  1086. <tr>
  1087. <td>tempdir</td>
  1088. <td>A directory, where <code>ejbdeploy</code> will write temporary files</td>
  1089. <td>No; defaults to <q>_ejbdeploy_temp</q></td>
  1090. </tr>
  1091. <tr>
  1092. <td>dbName<br/>dbSchema</td>
  1093. <td>These options are passed to <code>ejbdeploy</code>.</td>
  1094. <td>No</td>
  1095. </tr>
  1096. <tr>
  1097. <td>dbVendor</td>
  1098. <td>This option is passed to <code>ejbdeploy</code>. Valid options can be obtained by running
  1099. the following command: <pre>&lt;WAS_HOME&gt;/bin/EJBDeploy.[sh/bat] -help</pre> This is also
  1100. used to determine the name of the <code>Map.mapxmi</code> and <code>Schema.dbxmi</code> files,
  1101. for example <samp>Account-DB2UDBWIN_V71-Map.mapxmi</samp>
  1102. and <samp>Account-DB2UDBWIN_V71-Schema.dbxmi</samp>.</td>
  1103. <td>No</td>
  1104. </tr>
  1105. <tr>
  1106. <td>codegen<br/>quiet<br/>novalidate<br/>noinform<br/>trace<br/>use35MappingRules</td>
  1107. <td>These options are all passed to <code>ejbdeploy</code>.</td>
  1108. <td>No; default is <q>false</q> (except for <var>quiet</var>)</td>
  1109. </tr>
  1110. <tr>
  1111. <td>rmicOptions</td>
  1112. <td>This option is passed to <code>ejbdeploy</code> and will be passed on
  1113. to <code>rmic</code>.</td>
  1114. <td>No</td>
  1115. </tr>
  1116. </table>
  1117. <p>This example shows <code>ejbjar</code> being used to generate deployment jars for all deployment
  1118. descriptors in the <var>descriptordir</var>:</p>
  1119. <pre>
  1120. &lt;property name=&quot;websphere.home&quot; value=&quot;${was4.home}&quot;/&gt;
  1121. &lt;ejbjar srcdir="${build.class}" descriptordir="etc/ejb"&gt;
  1122. &lt;include name="*-ejb-jar.xml"/&gt;
  1123. &lt;websphere dbvendor="DB2UDBOS390_V6"
  1124. ejbdeploy="true"
  1125. oldCMP="false"
  1126. tempdir="/tmp"
  1127. destdir="${dist.server}"&gt;
  1128. &lt;wasclasspath&gt;
  1129. &lt;pathelement location="${was4.home}/deploytool/itp/plugins/org.eclipse.core.boot/boot.jar"/&gt;
  1130. &lt;pathelement location="${was4.home}/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime/batch.jar"/&gt;
  1131. &lt;pathelement location="${was4.home}/lib/xerces.jar"/&gt;
  1132. &lt;pathelement location="${was4.home}/lib/ivjejb35.jar"/&gt;
  1133. &lt;pathelement location="${was4.home}/lib/j2ee.jar"/&gt;
  1134. &lt;pathelement location="${was4.home}/lib/vaprt.jar"/&gt;
  1135. &lt;/wasclasspath&gt;
  1136. &lt;classpath&gt;
  1137. &lt;path refid="build.classpath"/&gt;
  1138. &lt;/classpath&gt;
  1139. &lt;/websphere&gt;
  1140. &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
  1141. location="${lib}/dtd/ejb-jar_1_1.dtd"/&gt;
  1142. &lt;/ejbjar&gt;</pre>
  1143. <h3 id="ejbjar_iplanet">iPlanet Application Server (iAS) element</h3>
  1144. <p>The <code>&lt;iplanet&gt;</code> nested element is used to build iAS-specific stubs and skeletons
  1145. and construct a JAR file which may be deployed to the iPlanet Application Server 6.0. The build
  1146. process will always determine if the EJB stubs/skeletons and the EJB jar file are up to date, and it
  1147. will do the minimum amount of work required.</p>
  1148. <p>Like the <code>weblogic</code> element, a naming convention for the EJB descriptors is most
  1149. commonly used to specify the name for the completed JAR file. For example, if the EJB
  1150. descriptor <samp>ejb/Account-ejb-jar.xml</samp> is found in the descriptor directory,
  1151. the <code>iplanet</code> element will search for an iAS-specific EJB descriptor file
  1152. named <samp>ejb/Account-ias-ejb-jar.xml</samp> (if it isn't found, the task will fail) and a JAR
  1153. file named <samp>ejb/Account.jar</samp> will be written in the destination directory. Note that
  1154. when the EJB descriptors are added to the JAR file, they are automatically
  1155. renamed <samp>META-INF/ejb-jar.xml</samp> and <samp>META-INF/ias-ejb-jar.xml</samp>.</p>
  1156. <p>Of course, this naming behaviour can be modified by specifying attributes in
  1157. the <code>ejbjar</code> task (for example, <var>basejarname</var>, <var>basenameterminator</var>,
  1158. and <var>flatdestdir</var>) as well as the <code>iplanet</code> element (for
  1159. example, <var>suffix</var>). Refer to the appropriate documentation for more details.</p>
  1160. <h3>Parameters</h3>
  1161. <table class="attr">
  1162. <tr>
  1163. <th>Attribute</th>
  1164. <th>Description</th>
  1165. <th>Required</th>
  1166. </tr>
  1167. <tr>
  1168. <td>destdir</td>
  1169. <td>The base directory into which the generated JAR files will be written. Each JAR file is
  1170. written in directories which correspond to their location within the <var>descriptordir</var>
  1171. namespace.</td>
  1172. <td>Yes</td>
  1173. </tr>
  1174. <tr>
  1175. <td>classpath</td>
  1176. <td>The classpath used when generating EJB stubs and skeletons. If
  1177. specified, <var>classpath</var> will be prepended to the classpath specified in the
  1178. parent <code>ejbjar</code> task. Note that nested <code>classpath</code> elements may also be
  1179. used.</td>
  1180. <td>No; defaults to the classpath specified in the <code>ejbjar</code> parent task</td>
  1181. </tr>
  1182. <tr>
  1183. <td>keepgenerated</td>
  1184. <td>Indicates whether or not the Java source files which are generated by <code>ejbc</code> will
  1185. be saved or automatically deleted. If <q>yes</q>, the source files will be retained.</td>
  1186. <td>No; defaults to <q>no</q></td>
  1187. </tr>
  1188. <tr>
  1189. <td>debug</td>
  1190. <td>Indicates whether or not the <code>ejbc</code> utility should log additional debugging
  1191. statements to the standard output. If <q>yes</q>, the additional debugging statements will be
  1192. generated.</td>
  1193. <td>No; defaults to <q>no</q></td>
  1194. </tr>
  1195. <tr>
  1196. <td>iashome</td>
  1197. <td>May be used to specify the "home" directory for this iAS installation. This is used to find
  1198. the <code>ejbc</code> utility if it isn't included in the user's system path. If specified,
  1199. it should refer to the <samp>[install-location]/iplanet/ias6/ias</samp> directory.</td>
  1200. <td>No; by default, the <code>ejbc</code> utility must be on the user's system path.</td>
  1201. </tr>
  1202. <tr>
  1203. <td>suffix</td>
  1204. <td>String value appended to the JAR filename when creating each JAR.</td>
  1205. <td>No; defaults to <q>.jar</q></td>
  1206. </tr>
  1207. </table>
  1208. <p>As noted above, the <code>iplanet</code> element supports
  1209. additional <code>&lt;classpath&gt;</code> nested elements.</p>
  1210. <h3>Examples</h3>
  1211. <p>This example demonstrates the typical use of the <code>&lt;iplanet&gt;</code> nested element. It
  1212. will name each EJB jar using the "basename" prepended to each standard EJB descriptor. For example,
  1213. if the descriptor named <samp>Account-ejb-jar.xml</samp> is processed, the EJB-JAR will be
  1214. named <samp>Account.jar</samp></p>
  1215. <pre>
  1216. &lt;ejbjar srcdir="${build.classesdir}"
  1217. descriptordir="${src}"&gt;
  1218. &lt;iplanet destdir="${assemble.ejbjar}"
  1219. classpath="${ias.ejbc.cpath}"/&gt;
  1220. &lt;include name="**/*-ejb-jar.xml"/&gt;
  1221. &lt;exclude name="**/*ias-*.xml"/&gt;
  1222. &lt;/ejbjar&gt;</pre>
  1223. <p>This example demonstrates the use of a nested <code>classpath</code> element as well as some of
  1224. the other optional attributes.</p>
  1225. <pre>
  1226. &lt;ejbjar srcdir="${build.classesdir}"
  1227. descriptordir="${src}"&gt;
  1228. &lt;iplanet destdir="${assemble.ejbjar}"
  1229. iashome="${ias.home}"
  1230. debug="yes"
  1231. keepgenerated="yes"&gt;
  1232. &lt;classpath&gt;
  1233. &lt;pathelement path="."/&gt;
  1234. &lt;pathelement path="${build.classpath}"/&gt;
  1235. &lt;/classpath&gt;
  1236. &lt;/iplanet&gt;
  1237. &lt;include name="**/*-ejb-jar.xml"/&gt;
  1238. &lt;exclude name="**/*ias-*.xml"/&gt;
  1239. &lt;/ejbjar&gt;</pre>
  1240. <p>This example demonstrates the use of <var>basejarname</var> attribute. In this case, the
  1241. completed EJB jar will be named <samp>HelloWorld.jar</samp>. If multiple EJB descriptors might be
  1242. found, care must be taken to ensure that the completed JAR files don't overwrite each other.</p>
  1243. <pre>
  1244. &lt;ejbjar srcdir="${build.classesdir}"
  1245. descriptordir="${src}"
  1246. basejarname="HelloWorld"&gt;
  1247. &lt;iplanet destdir="${assemble.ejbjar}"
  1248. classpath="${ias.ejbc.cpath}"/&gt;
  1249. &lt;include name="**/*-ejb-jar.xml"/&gt;
  1250. &lt;exclude name="**/*ias-*.xml"/&gt;
  1251. &lt;/ejbjar&gt;</pre>
  1252. <p>This example demonstrates the use of the <code>dtd</code> nested element. If the local copies of
  1253. the DTDs are included in the classpath, they will be automatically referenced without the nested
  1254. elements. In iAS 6.0 SP2, these local DTDs are found in
  1255. the <samp>[iAS-install-directory]/APPS</samp> directory. In iAS 6.0 SP3, these local DTDs are found
  1256. in the <samp>[iAS-install-directory]/dtd</samp> directory.</p>
  1257. <pre>
  1258. &lt;ejbjar srcdir="${build.classesdir}"
  1259. descriptordir="${src}"&gt;
  1260. &lt;iplanet destdir="${assemble.ejbjar}"&gt;
  1261. classpath="${ias.ejbc.cpath}"/&gt;
  1262. &lt;include name="**/*-ejb-jar.xml"/&gt;
  1263. &lt;exclude name="**/*ias-*.xml"/&gt;
  1264. &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
  1265. location="${ias.home}/APPS/ejb-jar_1_1.dtd"/&gt;
  1266. &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN"
  1267. location="${ias.home}/APPS/IASEjb_jar_1_0.dtd"/&gt;
  1268. &lt;/ejbjar&gt;</pre>
  1269. <h3 id="ejbjar_jonas">JOnAS (Java Open Application Server) element</h3>
  1270. <p>The <code>&lt;jonas&gt;</code> nested element is used to build JOnAS-specific stubs and skeletons
  1271. thanks to the <code>GenIC</code> specific tool, and construct a JAR file which may be deployed to
  1272. the JOnAS Application Server. The build process will always determine if the EJB stubs/skeletons and
  1273. the EJB jar file are up to date, and it will do the minimum amount of work required.</p>
  1274. <p>Like the WebLogic element, a naming convention for the EJB descriptors is most commonly used to
  1275. specify the name for the completed JAR file. For example, if the EJB
  1276. descriptor <samp>ejb/Account-ejb-jar.xml</samp> is found in the descriptor directory,
  1277. the <code>&lt;jonas&gt;</code> element will search for a JOnAS-specific EJB descriptor file
  1278. named <samp>ejb/Account-jonas-ejb-jar.xml</samp> and a JAR file named <samp>ejb/Account.jar</samp>
  1279. will be written in the destination directory. But the <code>&lt;jonas&gt;</code> element can also
  1280. use the JOnAS naming convention. With the same example as below, the EJB descriptor can also be
  1281. named <samp>ejb/Account.xml</samp> (no base name terminator here) in the descriptor directory. Then
  1282. the <code>&lt;jonas&gt;</code> element will search for a JOnAS-specific EJB descriptor file
  1283. called <samp>ejb/jonas-Account.xml</samp>. This convention do not follow strictly the EJB jar naming
  1284. convention recommendation but is supported for backward compatibility with previous version of
  1285. JOnAS.</p>
  1286. <p>Note that when the EJB descriptors are added to the JAR file, they are automatically
  1287. renamed <samp>META-INF/ejb-jar.xml</samp> and <samp>META-INF/jonas-ejb-jar.xml</samp>.</p>
  1288. <p>Of course, this naming behavior can be modified by specifying attributes in
  1289. the <code>ejbjar</code> task (for example, <var>basejarname</var>, <var>basenameterminator</var>,
  1290. and <var>flatdestdir</var>) as well as the <code>iplanet</code> element (for
  1291. example, <var>suffix</var>). Refer to the appropriate documentation for more details.</p>
  1292. <h3>Parameters</h3>
  1293. <table class="attr">
  1294. <tbody>
  1295. <tr>
  1296. <th>Attribute</th>
  1297. <th>Description</th>
  1298. <th>Required</th>
  1299. </tr>
  1300. <tr>
  1301. <td>destdir</td>
  1302. <td>The base directory into which the generated JAR files will be written. Each JAR file is
  1303. written in directories which correspond to their location within
  1304. the <var>descriptordir</var> namespace.</td>
  1305. <td>Yes</td>
  1306. </tr>
  1307. <tr>
  1308. <td>jonasroot</td>
  1309. <td>The root directory for JOnAS.</td>
  1310. <td>Yes</td>
  1311. </tr>
  1312. <tr>
  1313. <td>classpath</td>
  1314. <td>The classpath used when generating EJB stubs and skeletons. If
  1315. specified, <var>classpath</var> will be prepended to the classpath specified in the
  1316. parent <code>ejbjar</code> task (see also the ORB attribute documentation below). Note that
  1317. nested <code>classpath</code> elements may also be used.</td>
  1318. <td>No; defaults to the classpath specified in the <code>ejbjar</code> parent task</td>
  1319. </tr>
  1320. <tr>
  1321. <td>keepgenerated</td>
  1322. <td><q>true</q> if the intermediate Java source files generated by GenIC must be deleted or
  1323. not.</td>
  1324. <td>No; defaults to <q>false</q></td>
  1325. </tr>
  1326. <tr>
  1327. <td>nocompil</td>
  1328. <td><q>true</q> if the generated source files must not be compiled via the Java and RMI
  1329. compilers.</td>
  1330. <td>No; defaults to <q>false</q></td>
  1331. </tr>
  1332. <tr>
  1333. <td>novalidation</td>
  1334. <td><q>true</q> if the XML deployment descriptors must be parsed without validation.</td>
  1335. <td>No; defaults to <q>false</q></td>
  1336. </tr>
  1337. <tr>
  1338. <td>javac</td>
  1339. <td>Java compiler to use.</td>
  1340. <td>No; defaults
  1341. to the value of <code>build.compiler</code> property</td>
  1342. </tr>
  1343. <tr>
  1344. <td>javacopts</td>
  1345. <td>Options to pass to the Java compiler.</td>
  1346. <td>No</td>
  1347. </tr>
  1348. <tr>
  1349. <td>rmicopts</td>
  1350. <td>Options to pass to the RMI compiler.</td>
  1351. <td>No</td>
  1352. </tr>
  1353. <tr>
  1354. <td>secpropag</td>
  1355. <td><q>true</q> if the RMI skeletons and stubs must be modified to implement the implicit
  1356. propagation of the security context (the transactional context is always provided).</td>
  1357. <td>No; defaults to <q>false</q></td>
  1358. </tr>
  1359. <tr>
  1360. <td>verbose</td>
  1361. <td>Indicates whether or not to use <code>-verbose</code> switch.</td>
  1362. <td>No; defaults to <q>false</q></td>
  1363. </tr>
  1364. <tr>
  1365. <td>additionalargs</td>
  1366. <td>Add additional args to GenIC.</td>
  1367. <td>No</td>
  1368. </tr>
  1369. <tr>
  1370. <td>keepgeneric</td>
  1371. <td><q>true</q> if the generic JAR file used as input to GenIC must be retained.</td>
  1372. <td>No; defaults to <q>false</q></td>
  1373. </tr>
  1374. <tr>
  1375. <td>jarsuffix</td>
  1376. <td>String value appended to the JAR filename when creating each JAR.</td>
  1377. <td>No; defaults to <q>.jar</q></td>
  1378. </tr>
  1379. <tr>
  1380. <td>orb</td>
  1381. <td>Choose your ORB: <q>RMI</q>, <q>JEREMIE</q>, <q>DAVID</q>. If specified, the
  1382. corresponding JOnAS JAR is automatically added to the classpath.</td>
  1383. <td>No; defaults to the one present in classpath</td>
  1384. </tr>
  1385. <tr>
  1386. <td>nogenic</td>
  1387. <td>If this attribute is set to <q>true</q>, JOnAS's GenIC will not be run on the EJB jar. Use
  1388. this if you prefer to run GenIC at deployment time.</td>
  1389. <td>No; defaults to <q>false</q></td>
  1390. </tr>
  1391. <tr>
  1392. </tbody>
  1393. </table>
  1394. <p>As noted above, the <code>jonas</code> element supports additional <code>&lt;classpath&gt;</code>
  1395. nested elements.</p>
  1396. <h3>Examples</h3>
  1397. <p>This example shows <code>ejbjar</code> being used to generate deployment jars using a JOnAS EJB
  1398. container. This example requires the naming standard to be used for the deployment
  1399. descriptors. Using this format will create a EJB jar file for each variation
  1400. of <samp>*-jar.xml</samp> that is found in the deployment descriptor directory.</p>
  1401. <pre>
  1402. &lt;ejbjar srcdir="${build.classes}"
  1403. descriptordir="${descriptor.dir}"&gt;
  1404. &lt;jonas destdir="${deploymentjars.dir}"
  1405. jonasroot="${jonas.root}"
  1406. orb="RMI"/&gt;
  1407. &lt;include name="**/*.xml"/&gt;
  1408. &lt;exclude name="**/jonas-*.xml"/&gt;
  1409. &lt;support dir="${build.classes}"&gt;
  1410. &lt;include name="**/*.class"/&gt;
  1411. &lt;/support&gt;
  1412. &lt;/ejbjar&gt;</pre>
  1413. <p>This example shows <code>ejbjar</code> being used to generate a single deployment jar using a
  1414. JOnAS EJB container. This example does require the deployment descriptors to use the naming
  1415. standard. This will create only one EJB jar file&mdash;<samp>TheEJBJar.jar</samp>.</p>
  1416. <pre>
  1417. &lt;ejbjar srcdir="${build.classes}"
  1418. descriptordir="${descriptor.dir}"
  1419. basejarname="TheEJBJar"&gt;
  1420. &lt;jonas destdir="${deploymentjars.dir}"
  1421. jonasroot="${jonas.root}"
  1422. suffix=".jar"
  1423. classpath="${descriptorbuild.classpath}"/&gt;
  1424. &lt;include name="**/ejb-jar.xml"/&gt;
  1425. &lt;exclude name="**/jonas-ejb-jar.xml"/&gt;
  1426. &lt;/ejbjar&gt;</pre>
  1427. <h3 id="ejbjar_orion">Orion element</h3>
  1428. <p>The <code>orion</code> element searches for the Orion Application Server specific deployment
  1429. descriptors and adds them to the final EJB jar file. Orion has one deployment descriptor:</p>
  1430. <ul>
  1431. <li><samp>orion-ejb-jar.xml</samp></li>
  1432. </ul>
  1433. <table class="attr">
  1434. <tr>
  1435. <th>Attribute</th>
  1436. <th>Description</th>
  1437. <th>Required</th>
  1438. </tr>
  1439. <tr>
  1440. <td>destdir</td>
  1441. <td>The base directory into which the generated jar files are deposited. Jar files are deposited
  1442. in directories corresponding to their location within the <var>descriptordir</var>
  1443. namespace.</td>
  1444. <td>Yes</td>
  1445. </tr>
  1446. </table>
  1447. <h3>Example</h3>
  1448. <pre>
  1449. &lt;ejbjar srcdir="${build.classes}"
  1450. descriptordir="${descriptor.dir}"
  1451. basejarname="TheEJBJar"
  1452. flatdestdir="true"
  1453. dependency="super"
  1454. genericjarsuffix=".jar"&gt;
  1455. &lt;include name="**/*-ejb-jar.xml"/&gt;
  1456. &lt;orion destdir="${deploymentjars.dir}"\&gt;
  1457. &lt;/ejbjar&gt;</pre>
  1458. </body>
  1459. </html>