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 54 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Apache Ant EJB Tasks</title>
  5. </head>
  6. <body>
  7. <h1>Ant EJB Tasks User Manual</h1>
  8. <p>by</p>
  9. <!-- Names are in alphabetical order, on last name -->
  10. <ul>
  11. <li>Paul Austin (<a href="mailto:p_d_austin@yahoo.com">p_d_austin@yahoo.com</a>)</li>
  12. <li>Tim Fennell (<a href="mailto:tfenne@rcn.com">tfenne@rcn.com</a>)</li>
  13. <li>Martin Gee (<a href="mailto:martin.gee@icsynergy.com">martin.gee@icsynergy.com</a>)</li>
  14. <li>Conor MacNeill (<a href="mailto:conor@cortexebusiness.com.au">conor@cortexebusiness.com.au</a>)</li>
  15. <li>Greg Nelson (<a href="mailto:greg@netscape.com">greg@netscape.com</a>)</li>
  16. </ul>
  17. <p>Version @VERSION@<br>
  18. $Id$
  19. </p>
  20. <hr>
  21. <h2>Table of Contents</h2>
  22. <ul>
  23. <li><a href="#introduction">Introduction</a></li>
  24. <li><a href="#ejbtasks">EJB Tasks</a></li>
  25. </ul>
  26. <hr>
  27. <h2><a name="introduction">Introduction</a></h2>
  28. <p>Ant provides a number of optional tasks for developing
  29. <a href="http://java.sun.com/products/ejb" target="_top">Enterprise Java Beans (EJBs)</a>
  30. . In general these tasks are specific to the particular vendor's EJB Server.</p>
  31. <p> At present the tasks support:<br>
  32. </p>
  33. <ul>
  34. <li><a href="http://www.borland.com">Borland </a>
  35. Application Server 4.5</li>
  36. <li><a href="http://www.iplanet.com">iPlanet </a>
  37. Application Server 6.0</li>
  38. <li><a href="http://www.jboss.org/" target="_top">
  39. jboss 2.1</a> and above EJB servers</li>
  40. <li><a href="http://www.bea.com" target="_top">Weblogic</a>
  41. 4.5.1, 5.1, and 6.0 EJB servers</li>
  42. </ul>
  43. Over time we expect further optional tasks to support additional EJB Servers.
  44. <p>Ant provides a number of optional tasks for developing
  45. <a href="http://java.sun.com/products/ejb" target="_top">Enterprise Java Beans (EJBs)</a>.
  46. In general these tasks are specific to the particular vendor's EJB Server. At present the tasks support
  47. <a href="http://www.bea.com" target="_top">Weblogic</a> 4.5.1 and 5.1 EJB servers. Over time we expect further optional tasks
  48. to support additional EJB Servers.
  49. </p>
  50. <hr>
  51. <h2><a name="ejbtasks">EJB Tasks</a></h2>
  52. <table border="1" cellpadding="5">
  53. <tr><td>Task</td><td colspan="2">Application Servers</td></tr>
  54. <tr><td><a href="BorlandGenerateClient.html">blgenclient</a></td><td colspan="2">Borland Application Server 4.5</td></tr>
  55. <tr><td><a href="#ddcreator">ddcreator</a></td><td colspan="2">Weblogic 4.5.1</td></tr>
  56. <tr><td><a href="#ejbc">ejbc</a></td><td colspan="2">Weblogic 4.5.1</td></tr>
  57. <tr><td><a href="#iplanet-ejbc">iplanet-ejbc</a></td><td colspan="2">iPlanet Application Server 6.0</td></tr>
  58. <tr><td rowspan="5"><a href="#ejbjar">ejbjar</a></td><td colspan="2" align="center"><b>Nested Elements</b></td></tr>
  59. <tr><td><a href="BorlandEJBTasks.html">borland</a></td><td>Borland Application Server 4.5</td></tr>
  60. <tr><td><a href="#ejbjar_jboss">jBoss</a></td><td>jBoss</td></tr>
  61. <tr><td><a href="#ejbjar_iplanet">iPlanet</a></td><td>iPlanet Application Server 6.0</td></tr>
  62. <tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>Weblogic 5.1 &amp; 6.0</td></tr>
  63. <tr><td><a href="#wlrun">wlrun</a></td><td colspan="2">Weblogic 4.5.1, 5.1 &amp; 6.0</td></tr>
  64. <tr><td><a href="#wlstop">wlstop</a></td><td colspan="2">Weblogic 4.5.1, 5.1 &amp; 6.0</td></tr>
  65. </table>
  66. <hr>
  67. <h2><a name="ddcreator">ddcreator</a></h2>
  68. <h3><b>Description:</b></h3>
  69. <p>ddcreator will compile a set of Weblogic text-based deployment descriptors into a serialized
  70. EJB deployment descriptor. The selection of which of the text-based descriptors are to be compiled
  71. is based on the standard Ant include and exclude selection mechanisms.
  72. </p>
  73. <h3>Parameters:</h3>
  74. <table border="1" cellpadding="2" cellspacing="0">
  75. <tr>
  76. <td valign="top"><b>Attribute</b></td>
  77. <td valign="top"><b>Description</b></td>
  78. <td align="center" valign="top"><b>Required</b></td>
  79. </tr>
  80. <tr>
  81. <td valign="top">descriptors</td>
  82. <td valign="top">This is the base directory from which descriptors are selected.</td>
  83. <td valign="top" align="center">Yes</td>
  84. </tr>
  85. <tr>
  86. <td valign="top">dest</td>
  87. <td valign="top">The directory where the serialised deployment descriptors will be written</td>
  88. <td valign="top" align="center">Yes</td>
  89. </tr>
  90. <tr>
  91. <td valign="top">classpath</td>
  92. <td valign="top">This is the classpath to use to run the underlying weblogic ddcreator tool.
  93. This must include the <code>weblogic.ejb.utils.DDCreator</code> class</td>
  94. <td valign="top" align="center">No</td>
  95. </tr>
  96. </table>
  97. <h3>Examples</h3>
  98. <pre>&lt;ddcreator descriptors=&quot;${dd.dir}&quot;
  99. dest=&quot;${gen.classes}&quot;
  100. classpath=&quot;${descriptorbuild.classpath}&quot;&gt;
  101. &lt;include name=&quot;*.txt&quot; /&gt;
  102. &lt;/ddcreator&gt;
  103. </pre>
  104. <hr>
  105. <h2><a name="ejbc">ejbc</a></h2>
  106. <h3><b>Description:</b></h3>
  107. <p>The ejbc task will run Weblogic's ejbc tool. This tool will take a serialised deployment descriptor,
  108. examine the various EJB interfaces and bean classes and then generate the required support classes
  109. necessary to deploy the bean in a Weblogic EJB container. This will include the RMI stubs and skeletons
  110. as well as the classes which implement the bean's home and remote interfaces.</p>
  111. <p>
  112. The ant task which runs this tool is able to compile several beans in a single operation. The beans to be
  113. compiled are selected by including their serialised deployment descriptors. The standard ant
  114. <code>include</code> and <code>exclude</code> constructs can be used to select the deployment descriptors
  115. to be included. </p>
  116. <p>
  117. Each descriptor is examined to determine whether the generated classes are out of date and need to be
  118. regenerated. The deployment descriptor is de-serialized to discover the home, remote and
  119. implementation classes. The corresponding source files are determined and checked to see their
  120. modification times. These times and the modification time of the serialised descriptor itself are
  121. compared with the modification time of the generated classes. If the generated classes are not present
  122. or are out of date, the ejbc tool is run to generate new versions.</p>
  123. <h3>Parameters:</h3>
  124. <table border="1" cellpadding="2" cellspacing="0">
  125. <tr>
  126. <td valign="top"><b>Attribute</b></td>
  127. <td valign="top"><b>Description</b></td>
  128. <td align="center" valign="top"><b>Required</b></td>
  129. </tr>
  130. <tr>
  131. <td valign="top">descriptors</td>
  132. <td valign="top">This is the base directory from which the serialised deployment descriptors are selected.</td>
  133. <td valign="top" align="center">Yes</td>
  134. </tr>
  135. <tr>
  136. <td valign="top">dest</td>
  137. <td valign="top">The base directory where the generated classes, RIM stubs and RMI skeletons are written</td>
  138. <td valign="top" align="center">Yes</td>
  139. </tr>
  140. <tr>
  141. <td valign="top">manifest</td>
  142. <td valign="top">The name of a manifest file to be written. This manifest will contain an entry for each EJB processed</td>
  143. <td valign="top" align="center">Yes</td>
  144. </tr>
  145. <tr>
  146. <td valign="top">src</td>
  147. <td valign="top">The base directory of the source tree containing the source files of the home interface,
  148. remote interface and bean implementation classes.</td>
  149. <td valign="top" align="center">Yes</td>
  150. </tr>
  151. <tr>
  152. <td valign="top">classpath</td>
  153. <td valign="top">This classpath must include both the <code>weblogic.ejbc</code> class and the
  154. classfiles of the bean, home interface, remote interface, etc of the bean being
  155. processed.</td>
  156. <td valign="top" align="center">No</td>
  157. </tr>
  158. </table>
  159. <h3>Examples</h3>
  160. <pre>&lt;ejbc descriptors=&quot;${gen.classes}&quot;
  161. src=&quot;${src.dir}&quot;
  162. dest=&quot;${gen.classes}&quot;
  163. manifest=&quot;${build.manifest}&quot;
  164. classpath=&quot;${descriptorbuild.classpath}&quot;&gt;
  165. &lt;include name=&quot;*.ser&quot; /&gt;
  166. &lt;/ejbc&gt;
  167. </pre>
  168. <hr>
  169. <h2>
  170. <a NAME="iplanet-ejbc"></a>iplanet-ejbc</h2>
  171. <h3>
  172. <b>Description:</b></h3>
  173. Task to compile EJB stubs and skeletons for the iPlanet Application Server
  174. 6.0. Given a standard EJB 1.1 XML descriptor as well as an iAS-specific
  175. EJB descriptor, this task will generate the stubs and skeletons required
  176. to deploy the EJB to iAS. Since the XML descriptors can include multiple
  177. EJBs, this is a convenient way of specifying many EJBs in a single Ant
  178. task.
  179. <p>For each EJB specified, the task will locate the three classes that
  180. comprise the EJB in the destination directory. If these class files
  181. cannot be located in the destination directory, the task will fail. The
  182. task will also attempt to locate the EJB stubs and skeletons in this directory.
  183. If found, the timestamps on the stubs and skeletons will be checked to
  184. ensure they are up to date. Only if these files cannot be found or if they
  185. are out of date will the iAS ejbc utility be called to generate new stubs
  186. and skeletons.</p>
  187. <h3>
  188. Parameters:</h3>
  189. <table BORDER CELLSPACING=0 CELLPADDING=2 >
  190. <tr>
  191. <td VALIGN=TOP><b>Attribute</b></td>
  192. <td VALIGN=TOP><b>Description</b></td>
  193. <td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
  194. </tr>
  195. <tr>
  196. <td VALIGN=TOP>ejbdescriptor</td>
  197. <td VALIGN=TOP>Standard EJB 1.1 XML descriptor (typically titled "ejb-jar.xml").</td>
  198. <td ALIGN=CENTER VALIGN=TOP>Yes</td>
  199. </tr>
  200. <tr>
  201. <td VALIGN=TOP>iasdescriptor</td>
  202. <td VALIGN=TOP>iAS-specific EJB XML descriptor (typically titled "ias-ejb-jar.xml").</td>
  203. <td ALIGN=CENTER VALIGN=TOP>Yes</td>
  204. </tr>
  205. <tr>
  206. <td VALIGN=TOP>dest</td>
  207. <td VALIGN=TOP>The is the base directory where the RMI stubs and skeletons
  208. are written. In addition, the class files for each bean (home interface,
  209. remote interface, and EJB implementation) must be found in this directory.</td>
  210. <td ALIGN=CENTER VALIGN=TOP>Yes</td>
  211. </tr>
  212. <tr>
  213. <td VALIGN=TOP>classpath</td>
  214. <td VALIGN=TOP>The classpath used when generating EJB stubs and skeletons.
  215. If omitted, the classpath specified when Ant was started will be used.
  216. Nested "classpath" elements may also be used.</td>
  217. <td ALIGN=CENTER VALIGN=TOP>No</td>
  218. </tr>
  219. <tr>
  220. <td VALIGN=TOP>keepgenerated</td>
  221. <td VALIGN=TOP>Indicates whether or not the Java source files which are
  222. generated by ejbc will be saved or automatically deleted. If "yes", the
  223. source files will be retained. If omitted, it defaults to "no". </td>
  224. <td ALIGN=CENTER VALIGN=TOP>No</td>
  225. </tr>
  226. <tr>
  227. <td VALIGN=TOP>debug</td>
  228. <td>Indicates whether or not the ejbc utility should log additional debugging
  229. statements to the standard output. If "yes", the additional debugging statements
  230. will be generated. If omitted, it defaults to "no". </td>
  231. <td ALIGN=CENTER VALIGN=TOP>
  232. <center>No</center>
  233. </td>
  234. </tr>
  235. <tr>
  236. <td VALIGN=TOP>iashome</td>
  237. <td>May be used to specify the "home" directory for this iAS installation.
  238. This is used to find the ejbc utility if it isn't included in the user's
  239. system path. If specified, it should refer to the "[install-location]/iplanet/ias6/ias"
  240. directory. If omitted, the ejbc utility must be on the user's system path. </td>
  241. <td ALIGN=CENTER VALIGN=TOP>No</td>
  242. </tr>
  243. </table>
  244. <h3>
  245. Examples</h3>
  246. <pre>&lt;iplanet-ejbc ejbdescriptor="ejb-jar.xml"
  247. iasdescriptor="ias-ejb-jar.xml"
  248. dest="${build.classesdir}"
  249. classpath="${ias.ejbc.cpath}" />
  250. &lt;iplanet-ejbc ejbdescriptor="ejb-jar.xml"
  251. iasdescriptor="ias-ejb-jar.xml"
  252. dest="${build.classesdir}"
  253. keepgenerated="yes"
  254. debug="yes"
  255. iashome="${ias.home}" >
  256. &lt;classpath>
  257. &lt;pathelement path="." />
  258. &lt;pathelement path="${build.classpath}" />
  259. &lt;/classpath>
  260. &lt;/iplanet-ejbc>
  261. </pre>
  262. <hr>
  263. <h2><a name="wlrun">wlrun</a></h2>
  264. <h3><b>Description:</b></h3>
  265. <p>The <code>wlrun</code> task is used to start a weblogic server. The task runs
  266. a weblogic instance in a separate Java Virtual Machine. A number of parameters
  267. are used to control the operation of the weblogic instance. Note that the task,
  268. and hence ant, will not complete until the weblogic instance is stopped.</p>
  269. <h3>Parameters:</h3>
  270. <table border="1" cellpadding="2" cellspacing="0">
  271. <tr>
  272. <td valign="top"><b>Attribute</b></td>
  273. <td valign="top"><b>Description</b></td>
  274. <td align="center" valign="top"><b>Required for 4.5.1 and 5.1</b></td>
  275. <td align="center" valign="top"><b>Required for 6.0</b></td>
  276. </tr>
  277. <tr>
  278. <td valign="top">BEA Home</td>
  279. <td valign="top">The location of the BEA Home qwhere the server's config is defined.
  280. If this attribute is present, wlrun assumes that the server will
  281. be running under Weblogic 6.0</td>
  282. <td valign="top" align="center">N/A</td>
  283. <td valign="top" align="center">Yes</td>
  284. </tr>
  285. <tr>
  286. <td valign="top">home</td>
  287. <td valign="top">The location of the weblogic home that is to be used. This is the location
  288. where weblogic is installed.</td>
  289. <td valign="top" align="center">Yes</td>
  290. <td valign="top" align="center">Yes. Note this is the absolute location, not relative to
  291. BEA home.</td>
  292. </tr>
  293. <tr>
  294. <td valign="top">Domain</td>
  295. <td valign="top">The domain to which the server belongs.</td>
  296. <td valign="top" align="center">N/A</td>
  297. <td valign="top" align="center">Yes</td>
  298. </tr>
  299. <tr>
  300. <td valign="top">classpath</td>
  301. <td valign="top">The classpath to be used with the Java Virtual Machine that runs the Weblogic
  302. Server. Prior to Weblogic 6.0, this is typically set to the Weblogic
  303. boot classpath. Under Weblogic 6.0 this should include all the
  304. weblogic jars</td>
  305. <td valign="top" align="center">Yes</td>
  306. <td valign="top" align="center">Yes</td>
  307. </tr>
  308. <tr>
  309. <td valign="top">wlclasspath</td>
  310. <td valign="top">The weblogic classpath used by the Weblogic Server.</td>
  311. <td valign="top" align="center">No</td>
  312. <td valign="top" align="center">N/A</td>
  313. </tr>
  314. <tr>
  315. <td valign="top">properties</td>
  316. <td valign="top">The name of the server's properties file within the weblogic home directory
  317. used to control the weblogic instance.</td>
  318. <td valign="top" align="center">Yes</td>
  319. <td valign="top" align="center">N/A</td>
  320. </tr>
  321. <tr>
  322. <td valign="top">name</td>
  323. <td valign="top">The name of the weblogic server within the weblogic home which is to be run.
  324. This defaults to &quot;myserver&quot;</td>
  325. <td valign="top" align="center">No</td>
  326. <td valign="top" align="center">No</td>
  327. </tr>
  328. <tr>
  329. <td valign="top">policy</td>
  330. <td valign="top">The name of the security policy file within the weblogic home directory that
  331. is to be used. If not specified, the default policy file <code>weblogic.policy</code>
  332. is used.</td>
  333. <td valign="top" align="center">No</td>
  334. <td valign="top" align="center">No</td>
  335. </tr>
  336. <tr>
  337. <td valign="top">username</td>
  338. <td valign="top">The management username used to manage the server</td>
  339. <td valign="top" align="center">N/A</td>
  340. <td valign="top" align="center">No</td>
  341. </tr>
  342. <tr>
  343. <td valign="top">password</td>
  344. <td valign="top">The server's management password</td>
  345. <td valign="top" align="center">N/A</td>
  346. <td valign="top" align="center">Yes</td>
  347. </tr>
  348. <tr>
  349. <td valign="top">pkPassword</td>
  350. <td valign="top">The private key password so the server can decrypt the SSL
  351. private key file</td>
  352. <td valign="top" align="center">N/A</td>
  353. <td valign="top" align="center">No</td>
  354. </tr>
  355. <tr>
  356. <td valign="top">jvmargs</td>
  357. <td valign="top">Additional argument string passed to the Java Virtual Machine used to run the
  358. Weblogic instance.</td>
  359. <td valign="top" align="center">No</td>
  360. <td valign="top" align="center">No</td>
  361. </tr>
  362. <tr>
  363. <td valign="top">args</td>
  364. <td valign="top">Additional argument string passed to the Weblogic instance.</td>
  365. <td valign="top" align="center">No</td>
  366. <td valign="top" align="center">No</td>
  367. </tr>
  368. </table>
  369. <h3>Nested Elements</h3>
  370. <p>The wlrun task supports nested &lt;classpath&gt; and &lt;wlclasspath&gt;
  371. elements to set the repsective classpaths.</p>
  372. <h3>Examples</h3>
  373. <p>This example shows the use of wlrun to run a server under Weblogic 5.1</p>
  374. <pre>
  375. &lt;wlrun taskname=&quot;myserver&quot;
  376. classpath=&quot;${weblogic.boot.classpath}&quot;
  377. wlclasspath=&quot;${weblogic.classes}:${code.jars}&quot;
  378. name=&quot;myserver&quot;
  379. home=&quot;${weblogic.home}&quot;
  380. properties=&quot;myserver/myserver.properties&quot;/&gt;
  381. </pre>
  382. <p>This example shows wlrun being used to run the petstore server under
  383. Weblogic 6.0</p>
  384. <pre>
  385. &lt;wlrun taskname=&quot;petstore&quot;
  386. classpath=&quot;${weblogic.classes}&quot;
  387. name=&quot;petstoreServer&quot;
  388. domain=&quot;petstore&quot;
  389. home=&quot;${weblogic.home}&quot;
  390. password=&quot;petstorePassword&quot;
  391. beahome=&quot;${bea.home}&quot;/&gt;
  392. </pre>
  393. <hr>
  394. <h2><a name="wlstop">wlstop</a></h2>
  395. <h3><b>Description:</b></h3>
  396. <p>The <code>wlstop</code> task is used to stop a weblogic instance which is
  397. currently running. To shut down an instance you must supply both a username and
  398. a password. These will be stored in the clear in the build script used to stop
  399. the instance. For security reasons, this task is therefore only appropriate in a
  400. development environment. </p>
  401. <p>This task works for most version of Weblogic, including 6.0. You need to
  402. specify the BEA Home to have this task work correctly under 6.0</p>
  403. <h3>Parameters:</h3>
  404. <table border="1" cellpadding="2" cellspacing="0">
  405. <tr>
  406. <td valign="top"><b>Attribute</b></td>
  407. <td valign="top"><b>Description</b></td>
  408. <td align="center" valign="top"><b>Required</b></td>
  409. </tr>
  410. <tr>
  411. <td valign="top">BEAHome</td>
  412. <td valign="top">This attribute selects Weblogic 6.0 shutdown.</td>
  413. <td valign="top" align="center">No</td>
  414. </tr>
  415. <tr>
  416. <td valign="top">classpath</td>
  417. <td valign="top">The classpath to be used with the Java Virtual Machine that runs the Weblogic
  418. Shutdown comment.</td>
  419. <td valign="top" align="center">Yes</td>
  420. </tr>
  421. <tr>
  422. <td valign="top">user</td>
  423. <td valign="top">The username of the account which will be used to shutdown the server</td>
  424. <td valign="top" align="center">Yes</td>
  425. </tr>
  426. <tr>
  427. <td valign="top">password</td>
  428. <td valign="top">The password for the account specified in the user parameter.</td>
  429. <td valign="top" align="center">Yes</td>
  430. </tr>
  431. <tr>
  432. <td valign="top">url</td>
  433. <td valign="top">The URL which describes the port to which the server is listening for T3 connections.
  434. For example, t3://localhost:7001</td>
  435. <td valign="top" align="center">Yes</td>
  436. </tr>
  437. <tr>
  438. <td valign="top">delay</td>
  439. <td valign="top">The delay in seconds after which the server will stop. This defaults to an
  440. immediate shutdown.</td>
  441. <td valign="top" align="center">No</td>
  442. </tr>
  443. </table>
  444. <h3>Nested Element</h3>
  445. <p>The classpath of the welstop task can be set by a &lt;classpath&gt; nested element.</p>
  446. <h3>Examples</h3>
  447. <p>This example show the shutdown for a Weblogic 6.0 server</p>
  448. <pre>
  449. &lt;wlstop classpath=&quot;${weblogic.classes}&quot;
  450. user=&quot;system&quot;
  451. url=&quot;t3://localhost:7001&quot;
  452. password=&quot;foobar&quot;
  453. beahome=&quot;${bea.home}&quot;/&gt;
  454. </pre>
  455. <hr>
  456. <h2><a name="ejbjar">ejbjar</a></h2>
  457. <h3><b>Description:</b></h3>
  458. <p>This task is designed to support building of EJB1.1 jar files. Support is
  459. currently provided for 'vanilla' EJB1.1 jar files - i.e. those containing only
  460. the user generated class files and the standard deployment descriptor. Nested
  461. elements provide support for vendor specific deployment tools. These currently
  462. include: </p>
  463. <ul>
  464. <li>Borland Application Server 4.5</li>
  465. <li>iPlanet Application Server 6.0</li>
  466. <li>Jboss 2.1 and above</li>
  467. <li>Weblogic 5.1/6.0 session/entity beans using the weblogic.ejbc tool</li>
  468. <li>TOPLink for WebLogic 2.5.1-enabled entity beans</li>
  469. </ul>
  470. <p>The task works as a directory scanning task, and performs an action for each
  471. deployment descriptor found. As such the includes and excludes should be set
  472. to ensure that all desired EJB1.1 descriptors are found, but no application
  473. server descriptors are found. For each descriptor found, ejbjar will parse the
  474. deployment descriptor to determine the necessary class files which implement the
  475. bean. These files are assembled along with the deployment descriptors into a
  476. well formed EJB jar file. Any support files which need to be included in the
  477. generated jar can be added with the &lt;support&gt; nested element. For each
  478. class included in the jar, ejbjar will scan for any super classes or super
  479. interfaces. These will be added to the generated jar.</p>
  480. <p>If no nested vendor-specific deployment elements are present, the task will
  481. simply generate a generic EJB jar. Such jars are typically used as the input to
  482. vendor-specific deployment tools. For each nested deployment element, a vendor
  483. specific deployment tool is run to generate a jar file ready for deployment in
  484. that vendor's EJB container. </p>
  485. <p>The jar files are only built if they are out of date. Each deployment tool
  486. element will examine its target jar file and determine if it is out of date with
  487. respect to the class files and deployment descriptors that make up the bean. If
  488. any of these files are newer than the jar file the jar will be rebuilt otherwise
  489. a message is logged that the jar file is up to date.</p>
  490. <h3>Naming Convention</h3>
  491. Ejbjar handles the processing of multiple beans, and it uses a set of naming
  492. conventions to determine the name of the generated EJB jars. The naming convention
  493. that is used is controlled by the &quot;naming&quot; attribute. It supports the
  494. following values
  495. <ul>
  496. <li>descriptor</li>
  497. <p>This is the default naming scheme. The name of the generated bean is derived from the
  498. name of the deployment descriptor. For an Account bean, for example, the deployment
  499. descriptor would be named <code>Account-ejb-jar.xml</code>. Vendor specific descriptors are
  500. located using the same naming convention. The weblogic bean, for example, would be named
  501. <code>Account-weblogic-ejb-jar.xml</code>. Under this arrangment, the deployment descriptors
  502. can be separated from the code implementing the beans, which can be useful whe the same bean code
  503. is deployed in separate beans.
  504. </p>
  505. <p>This scheme is useful when you are using one bean per EJB jar and where you may be
  506. deploying the same bean classes in different beans, with different deployment characteristics.
  507. <li>ejb-name</li>
  508. <p> This naming scheme uses the &lt;ejb-name&gt; element from the deployment descriptor to
  509. determine the bean name. In this situation, the descriptors normally use the generic
  510. descriptor names, such as <code>ejb-jar.xml</code> along with any associated vendor specific descriptor
  511. names. For example, If the value of the &lt;ejb-name&gt; were to be given in the deployment descriptor
  512. as follows:
  513. <pre>
  514. &lt;ejb-jar&gt;
  515. &lt;enterprise-beans&gt;
  516. &lt;entity&gt;
  517. &lt;ejb-name&gt;Sample&lt;/ejb-name&gt;
  518. &lt;home&gt;org.apache.ant.ejbsample.SampleHome&lt;/home&gt;
  519. </pre>
  520. then the name of the generated bean would be <code>Sample.jar</code>
  521. </p>
  522. <p> This scheme is useful where you want to use the standard deployment descriptor names, which may be more
  523. compatible with other EJB tools. This scheme must have one bean per jar.
  524. </p>
  525. <li>directory</li>
  526. <p>
  527. In this mode, the name of the generated bean jar is derived from the directory
  528. containing the deployment descriptors. Again the deployment descriptors typically use
  529. the standard filenames. For example, if the path to the deployment descriptor is
  530. <code>/home/user/dev/appserver/dd/sample</code>, then the generated
  531. bean will be named <code>sample.jar</code>
  532. </p>
  533. <p>
  534. This scheme is also useful when you want to use standard style descriptor names. It is often
  535. most useful when the descriptors are located in the same directory as the bean source code,
  536. although that is not mandatory. This scheme can handle multiple beans per jar.
  537. </p>
  538. <li>basejarname</li>
  539. <p>
  540. The final scheme supported by the &lt;ejbjar&gt; task is used when you want to specify the generated
  541. bean jar name directly. In this case the name of the generated jar is specified by the
  542. &quot;basejarname&quot; attribute. Since all generated beans will have the same name, this task should
  543. be only used when each descriptor is in its own directory.
  544. </p>
  545. <p>
  546. This scheme is most appropriate when you are using multiple beans per jar and only process a single
  547. deployment descriptor. You typically want to specify the name of the jar and not derive it from the
  548. beans in the jar.
  549. </p>
  550. </ul>
  551. <h3>Parameters:</h3>
  552. <table border="1" cellpadding="2" cellspacing="0">
  553. <tr>
  554. <td valign="top"><b>Attribute</b></td>
  555. <td valign="top"><b>Description</b></td>
  556. <td align="center" valign="top"><b>Required</b></td>
  557. </tr>
  558. <tr>
  559. <td valign="top">descriptordir</td>
  560. <td valign="top">The base directory under which to scan for EJB
  561. deployment descriptors. If this attribute is not
  562. specified, then the deployment descriptors must be
  563. located in the directory specified by the 'srcdir'
  564. attribute.</td>
  565. <td valign="top" align="center">No</td>
  566. </tr>
  567. <tr>
  568. <td valign="top">srcdir</td>
  569. <td valign="top">The base directory containing the .class files that
  570. make up the bean. Note that this can be the same as
  571. the descriptordir if all files are in the same directory
  572. tree.</td>
  573. <td valign="top" align="center">Yes</td>
  574. </tr>
  575. <tr>
  576. <td valign="top">destdir</td>
  577. <td valign="top">The base directory into which generated jar files are
  578. deposited. Jar files are deposited in directories
  579. corresponding to their location within the descriptordir
  580. namespace. Note that this attribute is only used if the
  581. task is generating generic jars (i.e. no vendor-specific
  582. deployment elements have been specified).</td>
  583. <td valign="top" align="center">Yes</td>
  584. </tr>
  585. <tr>
  586. <td valign="top">naming</td>
  587. <td valign="top">Controls the naming convention used to name generated
  588. EJB jars. Please refer to the description above.</td>
  589. <td valign="top" align="center">No</td>
  590. </tr>
  591. <tr>
  592. <td valign="top">basejarname</td>
  593. <td valign="top">The base name that is used for the generated jar files.
  594. If this attribute is specified, the generic jar file name
  595. will use this value as the prefix (followed by the value
  596. specified in the 'genericjarsuffix' attribute) and the
  597. resultant ejb jar file (followed by any suffix specified
  598. in the nested element).</td>
  599. <td valign="top" align="center">No</td>
  600. </tr>
  601. <tr>
  602. <td valign="top">basenameterminator</td>
  603. <td valign="top">String value used to substring out a string from the name
  604. of each deployment descriptor found, which is then used to
  605. locate related deployment descriptors (e.g. the WebLogic
  606. descriptors). For example, a basename of '.' and a
  607. deployment descriptor called 'FooBean.ejb-jar.xml' would
  608. result in a basename of 'FooBean' which would then be used
  609. to find FooBean.weblogic-ejb-jar.xml and
  610. FooBean.weblogic-cmp-rdbms-jar.xml, as well as to create
  611. the filenames of the jar files as FooBean-generic.jar and
  612. FooBean-wl.jar. This attribute is not used if the
  613. 'basejarname' attribute is specified.</td>
  614. <td valign="top" align="center">No, defaults to '-'.</td>
  615. </tr>
  616. <tr>
  617. <td valign="top">genericjarsuffix</td>
  618. <td valign="top">String value appended to the basename of the deployment
  619. descriptor to create the filename of the generic EJB jar
  620. file.</td>
  621. <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
  622. </tr>
  623. <tr>
  624. <td valign="top">classpath</td>
  625. <td valign="top">This classpath is used when resolving classes which
  626. are to be added to the jar. Typically nested deployment
  627. tool elements will also support a classpath which
  628. will be combined with this classpath when resolving
  629. classes</td>
  630. <td valign="top" align="center">No.</td>
  631. </tr>
  632. <tr>
  633. <td valign="top">flatdestdir</td>
  634. <td valign="top">Set this attribute to true if you want all generated jars
  635. to be placed in the root of the destdir, rather than
  636. according to the location of the deployment descriptor
  637. within the descriptor dir hierarchy.</td>
  638. <td valign="top" align="center">No.</td>
  639. </tr>
  640. </table>
  641. <h3>Nested Elements</h3>
  642. <p>In addition to the vendor specific nested elements, the ejbjar task provides
  643. three nested elements. </p>
  644. <h4>Classpath</h4>
  645. <p>The &lt;classpath&gt; nested element allows the classpath
  646. to be set. It is useful when setting the classpath from a reference path. In all
  647. other respects the behaviour is the same as the classpath attribute.</p>
  648. <h4>dtd</h4>
  649. <p>The &lt;dtd&gt; element is used to specify the local location of DTDs to be
  650. used when parsing the EJB deployment descriptor. Using a local DTD is much
  651. faster than loading the DTD across the net. If you are running ejbjar behind a
  652. firewall you may not even be able to access the remote DTD. The supported
  653. vendor-specific nested elements know the location of the required DTDs within
  654. the vendor class hierarchy and, in general, this means &lt;dtd&gt; elements are
  655. not required. It does mean, however, that the vendor's class hierarchy must be
  656. available in the classpath when Ant is started. If your want to run Ant without
  657. requiring the vendor classes in the classpath, you would need to use a
  658. &lt;dtd&gt; element.</p>
  659. <table border="1" cellpadding="2" cellspacing="0">
  660. <tr>
  661. <td valign="top"><b>Attribute</b></td>
  662. <td valign="top"><b>Description</b></td>
  663. <td align="center" valign="top"><b>Required</b></td>
  664. </tr>
  665. <tr>
  666. <td valign="top">publicId</td>
  667. <td valign="top">The public Id of the DTD for which the location is being provided</td>
  668. <td align="center" valign="top">Yes</td>
  669. </tr>
  670. <tr>
  671. <td valign="top">location</td>
  672. <td valign="top">The location of the local copy of the DTD. This can either be a
  673. file or a resource loadable from the classpath.</td>
  674. <td align="center" valign="top">Yes</td>
  675. </tr>
  676. </table>
  677. <h4>support</h4>
  678. <p>The &lt;support&gt; nested element is used to supply additional classes
  679. (files) to be included in the generated jars. The &lt;support&gt; element is a
  680. FileSet, so it can either reference a fileset declared elsewhere or it can be
  681. defined in-place with the appropriate &lt;include&gt; and &lt;exclude&gt; nested
  682. elements. The files in the support fileset are added into the generated EJB jar
  683. in the same relative location as their location within the support fileset. Note
  684. that when ejbjar generates more than one jar file, the support files are added
  685. to each one.</p>
  686. <h3>Vendor-specific deployment elements</h3>
  687. Each vendor-specific nested element controls the generation of a deployable jar
  688. specific to that vendor's EJB container. The parameters for each supported
  689. deployment element are detailed here.
  690. <h3><a name="ejbjar_jboss">Jboss element</a></h3>
  691. <p>The jboss element searches for the jboss specific deployment descriptors and adds them
  692. to the final ejb jar file. Jboss has two deployment descriptors jboss.xml and jaws.xml
  693. (for container manager persistance only). The Jboss server uses hot deployment and does
  694. not require compilation of additional stubs and skeletons.</p>
  695. <table border="1" cellpadding="2" cellspacing="0">
  696. <tr>
  697. <td valign="top"><b>Attribute</b></td>
  698. <td valign="top"><b>Description</b></td>
  699. <td align="center" valign="top"><b>Required</b></td>
  700. </tr>
  701. <tr>
  702. <td valign="top">destdir</td>
  703. <td valign="top">The base directory into which the generated weblogic ready
  704. jar files are deposited. Jar files are deposited in
  705. directories corresponding to their location within the
  706. descriptordir namespace. </td>
  707. <td valign="top" align="center">Yes</td>
  708. </tr>
  709. <tr>
  710. <td valign="top">genericjarsuffix</td>
  711. <td valign="top">A generic jar is generated as an intermediate step in
  712. build the weblogic deployment jar. The suffix used to
  713. generate the generic jar file is not particularly
  714. important unless it is desired to keep the generic
  715. jar file. It should not, however, be the same
  716. as the suffix setting.</td>
  717. <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
  718. </tr>
  719. <tr>
  720. <td valign="top">suffix</td>
  721. <td valign="top">String value appended to the basename of the deployment
  722. descriptor to create the filename of the WebLogic EJB
  723. jar file.</td>
  724. <td valign="top" align="center">No, defaults to '.jar'.</td>
  725. </tr>
  726. <tr>
  727. <td valign="top">keepgeneric</td>
  728. <td valign="top">This controls whether the generic file used as input to
  729. ejbc is retained.</td>
  730. <td valign="top" align="center">No, defaults to false</td>
  731. </tr>
  732. </table>
  733. <h3><a name="ejbjar_weblogic">Weblogic element</a></h3>
  734. <p>The weblogic element is used to control the weblogic.ejbc compiler for
  735. generating weblogic EJB jars. Prior to Ant 1.3, the method of locating CMP
  736. descriptors was to use the ejbjar naming convention. So if your ejb-jar was
  737. called, Customer-ejb-jar.xml, your weblogic descriptor was called Customer-
  738. weblogic-ejb-jar.xml and your CMP descriptor had to be Customer-weblogic-cmp-
  739. rdbms-jar.xml. In addition, the &lt;type-storage&gt; element in the weblogic
  740. descriptor had to be set to the standard name META-INF/weblogic-cmp-rdbms-
  741. jar.xml, as that is where the CMP descriptor was mapped to in the generated
  742. jar.</p>
  743. <p>There are a few problems with this scheme. It does not allow for more than
  744. one CMP descriptor to be defined in a jar and it is not compatible with the
  745. deployment descriptors generated by some tools.</p>
  746. <p>In Ant 1.3, ejbjar parses the weblogic deployment descriptor to discover the
  747. CMP descriptors, which are then included automatically. This behaviour is
  748. controlled by the newCMP attribute. Note that if you move to the new method of
  749. determining CMP descriptors, you will need to update your weblogic deployment
  750. descriptor's &lt;type-storage&gt; element. In the above example, you would
  751. define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.</p>
  752. <table border="1" cellpadding="2" cellspacing="0">
  753. <tr>
  754. <td valign="top"><b>Attribute</b></td>
  755. <td valign="top"><b>Description</b></td>
  756. <td align="center" valign="top"><b>Required</b></td>
  757. </tr>
  758. <tr>
  759. <td valign="top">destdir</td>
  760. <td valign="top">The base directory into which the generated weblogic ready
  761. jar files are deposited. Jar files are deposited in
  762. directories corresponding to their location within the
  763. descriptordir namespace. </td>
  764. <td valign="top" align="center">Yes</td>
  765. </tr>
  766. <tr>
  767. <td valign="top">genericjarsuffix</td>
  768. <td valign="top">A generic jar is generated as an intermediate step in
  769. build the weblogic deployment jar. The suffix used to
  770. generate the generic jar file is not particularly
  771. important unless it is desired to keep the generic
  772. jar file. It should not, however, be the same
  773. as the suffix setting.</td>
  774. <td valign="top" align="center">No, defaults to '-generic.jar'.</td>
  775. </tr>
  776. <tr>
  777. <td valign="top">suffix</td>
  778. <td valign="top">String value appended to the basename of the deployment
  779. descriptor to create the filename of the WebLogic EJB
  780. jar file.</td>
  781. <td valign="top" align="center">No, defaults to '.jar'.</td>
  782. </tr>
  783. <tr>
  784. <td valign="top">classpath</td>
  785. <td valign="top">The classpath to be used when running the weblogic ejbc
  786. tool. Note that this tool typically requires the classes
  787. that make up the bean to be available on the classpath.
  788. Currently, however, this will cause the ejbc tool to be
  789. run in a separate VM</td>
  790. <td valign="top" align="center">No</td>
  791. </tr>
  792. <tr>
  793. <td valign="top">wlclasspath</td>
  794. <td valign="top">Weblogic 6.0 will give a warning if the home and remote interfaces
  795. of a bean are on the system classpath used to run weblogic.ejbc.
  796. In that case, the standard weblogic classes should be set with
  797. this attribute (or equivalent nested element) and the
  798. home and remote interfaces located with the standard classpath
  799. attribute</td>
  800. <td valign="top" align="center">No</td>
  801. </tr>
  802. <tr>
  803. <td valign="top">keepgeneric</td>
  804. <td valign="top">This controls whether the generic file used as input to
  805. ejbc is retained.</td>
  806. <td valign="top" align="center">No, defaults to false</td>
  807. </tr>
  808. <tr>
  809. <td valign="top">compiler</td>
  810. <td valign="top">This allows for the selection of a different compiler
  811. to be used for the compilation of the generated Java
  812. files. This could be set, for example, to Jikes to
  813. compile with the Jikes compiler. If this is not set
  814. and the <code>build.compiler</code> property is set
  815. to jikes, the Jikes compiler will be used. If this
  816. is not desired, the value &quot;<code>default</code>&quot;
  817. may be given to use the default compiler</td>
  818. <td valign="top" align="center">No</td>
  819. </tr>
  820. <tr>
  821. <td valign="top">rebuild</td>
  822. <td valign="top">This flag controls whether weblogic.ejbc is always
  823. invoked to build the jar file. In certain circumstances,
  824. such as when only a bean class has been changed, the jar
  825. can be generated by merely replacing the changed classes
  826. and not rerunning ejbc. Setting this to false will reduce
  827. the time to run ejbjar.
  828. </td>
  829. <td valign="top" align="center">No, defaults to true.</td>
  830. </tr>
  831. <tr>
  832. <td valign="top">keepgenerated</td>
  833. <td valign="top">Controls whether weblogic will keep the generated Java
  834. files used to build the class files added to the
  835. jar. This can be useful when debugging
  836. </td>
  837. <td valign="top" align="center">No, defaults to false.</td>
  838. </tr>
  839. <tr>
  840. <td valign="top">args</td>
  841. <td valign="top">Any additional arguments to be passed to the weblogic.ejbc
  842. tool.
  843. </td>
  844. <td valign="top" align="center">No.</td>
  845. </tr>
  846. <tr>
  847. <td valign="top">weblogicdtd</td>
  848. <td valign="top"><b>Deprecated</b>. Defines the location of the ejb-jar DTD in
  849. the weblogic class hierarchy. This should not be necessary if you
  850. have weblogic in your classpath. If you do not, you should use a
  851. nested &lt;dtd&gt; element, described above. If you do choose
  852. to use an attribute, you should use the ejbdtd attribute in
  853. preference to this one, anyway.
  854. </td>
  855. <td valign="top" align="center">No.</td>
  856. </tr>
  857. <tr>
  858. <td valign="top">wldtd</td>
  859. <td valign="top"><b>Deprecated</b>. Defines the location of the weblogic-ejb-jar
  860. DTD which covers the Weblogic specific deployment descriptors.
  861. This should not be necessary if you have weblogic in your
  862. classpath. If you do not, you should use a nested &lt;dtd&gt;
  863. element, described above.
  864. </td>
  865. <td valign="top" align="center">No.</td>
  866. </tr>
  867. <tr>
  868. <td valign="top">ejbdtd</td>
  869. <td valign="top"><b>Deprecated</b>. Defines the location of the ejb-jar DTD in
  870. the weblogic class hierarchy. This should not be necessary if you
  871. have weblogic in your classpath. If you do not, you should use a
  872. nested &lt;dtd&gt; element, described above.
  873. </td>
  874. <td valign="top" align="center">No.</td>
  875. </tr>
  876. <tr>
  877. <td valign="top">newCMP</td>
  878. <td valign="top">If this is set to true, the new method for locating
  879. CMP descriptors will be used.</td>
  880. <td valign="top" align="center">No. Defaults to false</td>
  881. </tr>
  882. <tr>
  883. <td valign="top">oldCMP</td>
  884. <td valign="top"><b>Deprecated</b> This is an antonym for newCMP which should be used instead.</td>
  885. <td valign="top" align="center">No.</td>
  886. </tr>
  887. <tr>
  888. <td valign="top">noEJBC</td>
  889. <td valign="top">If this attribute is set to true, Weblogic's ejbc will not be run on the EJB jar.
  890. Use this if you prefer to run ejbc at deployment time.</td>
  891. <td valign="top" align="center">No.</td>
  892. </tr>
  893. </table>
  894. <p>The weblogic nested element itself supports two nested elements &lt;classpath&gt; and
  895. &lt;wlclasspath&gt; which are used to set the respective classpaths. These nested elements
  896. are useful when setting up class paths using reference Ids.</p>
  897. <h3>TOPLink for Weblogic element</h3>
  898. <p>The TopLink element is used to handle beans which use Toplink for the CMP operations. It
  899. is derived from the standard weblogic element so it supports the same set of attributes please these
  900. additional attributes</p>
  901. <table border="1" cellpadding="2" cellspacing="0">
  902. <tr>
  903. <td valign="top"><b>Attribute</b></td>
  904. <td valign="top"><b>Description</b></td>
  905. <td align="center" valign="top"><b>Required</b></td>
  906. </tr>
  907. <tr>
  908. <td valign="top">toplinkdescriptor</td>
  909. <td valign="top">This specifies the name of the TOPLink deployment descriptor file contained in the
  910. 'descriptordir' directory.</td>
  911. <td valign="top" align="center">Yes</td>
  912. </tr>
  913. <tr>
  914. <td valign="top">toplinkdtd</td>
  915. <td valign="top">This specifies the location of the TOPLink DTD file. This can be a file path or
  916. a file URL. This attribute is not required, but using a local DTD is recommended.</td>
  917. <td valign="top" align="center">No, defaults to dtd file at www.objectpeople.com.</td>
  918. </tr>
  919. </table>
  920. <h3>Examples</h3>
  921. <p>This example shows ejbjar being used to generate deployment jars using a
  922. Weblogic EJB container. This example requires the naming standard to be used for
  923. the deployment descriptors. Using this format will create a ejb jar file for
  924. each variation of '*-ejb-jar.xml' that is found in the deployment descriptor
  925. directory.</p>
  926. <pre>
  927. &lt;ejbjar srcdir=&quot;${build.classes}&quot;
  928. descriptordir=&quot;${descriptor.dir}&quot;&gt;
  929. &lt;weblogic destdir=&quot;${deploymentjars.dir}&quot;
  930. classpath=&quot;${descriptorbuild.classpath}&quot;/&gt;
  931. &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
  932. &lt;exclude name=&quot;**/*weblogic*.xml&quot;/&gt;
  933. &lt;/ejbjar&gt;
  934. </pre>
  935. <p>If weblogic is not in the Ant classpath, the following example
  936. shows how to specify the location of the weblogic DTDs. This
  937. example also show the use of a nested classpath element.</p>
  938. <pre>
  939. &lt;ejbjar descriptordir=&quot;${src.dir}&quot; srcdir=&quot;${build.classes}&quot;&gt;
  940. &lt;weblogic destdir=&quot;${deployment.webshop.dir}&quot;
  941. keepgeneric=&quot;true&quot;
  942. args=&quot;-g -keepgenerated ${ejbc.compiler}&quot;
  943. suffix=&quot;.jar&quot;
  944. oldCMP=&quot;false&quot;&gt;
  945. &lt;classpath&gt;
  946. &lt;pathelement path=&quot;${descriptorbuild.classpath}&quot;/&gt;
  947. &lt;/classpath&gt;
  948. &lt;/weblogic&gt;
  949. &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
  950. &lt;exclude name=&quot;**/*-weblogic-ejb-jar.xml&quot;/&gt;
  951. &lt;dtd publicId=&quot;-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN&quot;
  952. location=&quot;${weblogic.home}/classes/weblogic/ejb/deployment/xml/ejb-jar.dtd&quot;/&gt;
  953. &lt;dtd publicId=&quot;-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN&quot;
  954. location=&quot;${weblogic.home}/classes/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd&quot;/&gt;
  955. &lt;/ejbjar&gt;
  956. </pre>
  957. <p>This example shows ejbjar being used to generate a single deployment jar
  958. using a Weblogic EJB container. This example does not require the deployment
  959. descriptors to use the naming standard. This will create only one ejb jar file -
  960. 'TheEJBJar.jar'.</p>
  961. <pre>
  962. &lt;ejbjar srcdir=&quot;${build.classes}&quot;
  963. descriptordir=&quot;${descriptor.dir}&quot;
  964. basejarname=&quot;TheEJBJar&quot;&gt;
  965. &lt;weblogic destdir=&quot;${deploymentjars.dir}&quot;
  966. classpath=&quot;${descriptorbuild.classpath}&quot;/&gt;
  967. &lt;include name=&quot;**/ejb-jar.xml&quot;/&gt;
  968. &lt;exclude name=&quot;**/weblogic*.xml&quot;/&gt;
  969. &lt;/ejbjar&gt;
  970. </pre>
  971. <p>This example shows ejbjar being used to generate deployment jars for a TOPLink-enabled entity bean using a
  972. Weblogic EJB container. This example does not require the deployment descriptors to use the naming standard.
  973. This will create only one TOPLink-enabled ejb jar file - 'Address.jar'.</p>
  974. <pre>
  975. &lt;ejbjar srcdir=&quot;${build.dir}&quot;
  976. destdir=&quot;${solant.ejb.dir}&quot;
  977. descriptordir=&quot;${descriptor.dir}&quot;
  978. basejarname=&quot;Address&quot;&gt;
  979. &lt;weblogictoplink destdir=&quot;${solant.ejb.dir}&quot;
  980. classpath=&quot;${java.class.path}&quot;
  981. keepgeneric=&quot;false&quot;
  982. toplinkdescriptor=&quot;Address.xml&quot;
  983. toplinkdtd=&quot;file:///dtdfiles/toplink-cmp_2_5_1.dtd&quot;
  984. suffix=&quot;.jar&quot;/&gt;
  985. &lt;include name=&quot;**/ejb-jar.xml&quot;/&gt;
  986. &lt;exclude name=&quot;**/weblogic-ejb-jar.xml&quot;/&gt;
  987. &lt;/ejbjar&gt;
  988. </pre>
  989. <p>This final example shows how you would set-up ejbjar under Weblogic 6.0. It also shows the use of the
  990. &lt;support&gt; element to add support files</p>
  991. <pre>
  992. &lt;ejbjar descriptordir=&quot;${dd.dir}&quot; srcdir=&quot;${build.classes.server}&quot;&gt;
  993. &lt;include name=&quot;**/*-ejb-jar.xml&quot;/&gt;
  994. &lt;exclude name=&quot;**/*-weblogic-ejb-jar.xml&quot;/&gt;
  995. &lt;support dir=&quot;${build.classes.server}&quot;&gt;
  996. &lt;include name=&quot;**/*.class&quot;/&gt;
  997. &lt;/support&gt;
  998. &lt;weblogic destdir=&quot;${deployment.dir}&quot;
  999. keepgeneric=&quot;true&quot;
  1000. suffix=&quot;.jar&quot;
  1001. rebuild=&quot;false&quot;&gt;
  1002. &lt;classpath&gt;
  1003. &lt;pathelement path=&quot;${build.classes.server}&quot;/&gt;
  1004. &lt;/classpath&gt;
  1005. &lt;wlclasspath&gt;
  1006. &lt;pathelement path=&quot;${weblogic.classes}&quot;/&gt;
  1007. &lt;/wlclasspath&gt;
  1008. &lt;/weblogic&gt;
  1009. &lt;/ejbjar&gt;
  1010. </pre>
  1011. <h3><a name="ejbjar_iplanet">iPlanet Application Server (iAS) element</a></h3>
  1012. The &lt;iplanet> nested element is used to build iAS-specific stubs and
  1013. skeletons and construct a JAR file which may be deployed to the iPlanet
  1014. Application Server 6.0. The build process will always determine if
  1015. the EJB stubs/skeletons and the EJB-JAR file are up to date, and it will
  1016. do the minimum amount of work required.
  1017. <p>Like the WebLogic element, a naming convention for the EJB descriptors
  1018. is most commonly used to specify the name for the completed JAR file.
  1019. For example, if the EJB descriptor ejb/Account-ejb-jar.xml is found in
  1020. the descriptor directory, the iplanet element will search for an iAS-specific
  1021. EJB descriptor file named ejb/Account-ias-ejb-jar.xml (if it isn't found,
  1022. the task will fail) and a JAR file named ejb/Account.jar will be written
  1023. in the destination directory. Note that when the EJB descriptors
  1024. are added to the JAR file, they are automatically renamed META-INF/ejb-jar.xml
  1025. and META-INF/ias-ejb-jar.xml.</p>
  1026. <p>Of course, this naming behavior can be modified by specifying attributes
  1027. in the ejbjar task (for example, basejarname, basenameterminator, and flatdestdir)
  1028. as well as the iplanet element (for example, suffix). Refer to the
  1029. appropriate documentation for more details.</p>
  1030. <h3>
  1031. Parameters:</h3>
  1032. <table BORDER CELLSPACING=0 CELLPADDING=2 >
  1033. <tr>
  1034. <td VALIGN=TOP><b>Attribute</b></td>
  1035. <td VALIGN=TOP><b>Description</b></td>
  1036. <td ALIGN=CENTER VALIGN=TOP><b>Required</b></td>
  1037. </tr>
  1038. <tr>
  1039. <td VALIGN=TOP>destdir</td>
  1040. <td VALIGN=TOP>The base directory into which the generated JAR files will
  1041. be written. Each JAR file is written in directories which correspond to
  1042. their location within the "descriptordir" namespace.</td>
  1043. <td ALIGN=CENTER VALIGN=TOP>Yes</td>
  1044. </tr>
  1045. <tr>
  1046. <td VALIGN=TOP>classpath</td>
  1047. <td VALIGN=TOP>The classpath used when generating EJB stubs and skeletons.
  1048. If omitted, the classpath specified in the "ejbjar" parent task will be
  1049. used. If specified, the classpath elements will be prepended to the
  1050. classpath specified in the parent "ejbjar" task. Note that nested "classpath"
  1051. elements may also be used.</td>
  1052. <td ALIGN=CENTER VALIGN=TOP>No</td>
  1053. </tr>
  1054. <tr>
  1055. <td VALIGN=TOP>keepgenerated</td>
  1056. <td VALIGN=TOP>Indicates whether or not the Java source files which are
  1057. generated by ejbc will be saved or automatically deleted. If "yes", the
  1058. source files will be retained. If omitted, it defaults to "no". </td>
  1059. <td ALIGN=CENTER VALIGN=TOP>No</td>
  1060. </tr>
  1061. <tr>
  1062. <td VALIGN=TOP>debug</td>
  1063. <td>Indicates whether or not the ejbc utility should log additional debugging
  1064. statements to the standard output. If "yes", the additional debugging statements
  1065. will be generated. If omitted, it defaults to "no". </td>
  1066. <td ALIGN=CENTER VALIGN=TOP>No</td>
  1067. </tr>
  1068. <tr>
  1069. <td VALIGN=TOP>iashome</td>
  1070. <td>May be used to specify the "home" directory for this iAS installation.
  1071. This is used to find the ejbc utility if it isn't included in the user's
  1072. system path. If specified, it should refer to the [install-location]/iplanet/ias6/ias
  1073. directory. If omitted, the ejbc utility must be on the user's system
  1074. path. </td>
  1075. <td ALIGN=CENTER VALIGN=TOP>No</td>
  1076. </tr>
  1077. <tr>
  1078. <td VALIGN=TOP>suffix</td>
  1079. <td>String value appended to the JAR filename when creating each JAR.
  1080. If omitted, it defaults to ".jar". </td>
  1081. <td ALIGN=CENTER VALIGN=TOP>No</td>
  1082. </tr>
  1083. </table>
  1084. <p>As noted above, the iplanet element supports additional &lt;classpath>
  1085. nested elements.</p>
  1086. <h3>
  1087. Examples</h3>
  1088. This example demonstrates the typical use of the &lt;iplanet> nested element.
  1089. It will name each EJB-JAR using the "basename" prepended to each standard
  1090. EJB descriptor. For example, if the descriptor named "Account-ejb-jar.xml"
  1091. is processed, the EJB-JAR will be named "Account.jar"
  1092. <pre> &lt;ejbjar srcdir="${build.classesdir}"
  1093. descriptordir="${src}" >
  1094. &lt;iplanet destdir="${assemble.ejbjar}"
  1095. classpath="${ias.ejbc.cpath}" />
  1096. &lt;include name="**/*-ejb-jar.xml"/>
  1097. &lt;exclude name="**/*ias-*.xml"/>
  1098. &lt;/ejbjar></pre>
  1099. This example demonstrates the use of a nested classpath element as well
  1100. as some of the other optional attributes.
  1101. <pre> &lt;ejbjar srcdir="${build.classesdir}"
  1102. descriptordir="${src}" >
  1103. &lt;iplanet destdir="${assemble.ejbjar}"
  1104. iashome="${ias.home}"
  1105. debug="yes"
  1106. keepgenerated="yes" >
  1107. &lt;classpath>
  1108. &lt;pathelement path="." />
  1109. &lt;pathelement path="${build.classpath}" />
  1110. &lt;/classpath>
  1111. &lt;/iplanet>
  1112. &lt;include name="**/*-ejb-jar.xml"/>
  1113. &lt;exclude name="**/*ias-*.xml"/>
  1114. &lt;/ejbjar></pre>
  1115. This example demonstrates the use of basejarname attribute. In this
  1116. case, the completed EJB-JAR will be named "HelloWorld.jar" If multiple
  1117. EJB descriptors might be found, care must be taken to ensure that the completed
  1118. JAR files don't overwrite each other.
  1119. <pre> &lt;ejbjar srcdir="${build.classesdir}"
  1120. descriptordir="${src}"
  1121. basejarname="HelloWorld" >
  1122. &lt;iplanet destdir="${assemble.ejbjar}"
  1123. classpath="${ias.ejbc.cpath}"/>
  1124. &lt;include name="**/*-ejb-jar.xml"/>
  1125. &lt;exclude name="**/*ias-*.xml"/>
  1126. &lt;/ejbjar></pre>
  1127. This example demonstrates the use of the dtd nested element. If the local
  1128. copies of the DTDs are included in the classpath, they will be automatically
  1129. referenced without the nested elements. In iAS 6.0 SP2, these local DTDs are
  1130. found in the [iAS-install-directory]/APPS directory. In iAS 6.0 SP3, these
  1131. local DTDs are found in the [iAS-install-directory]/dtd directory.
  1132. <pre> &lt;ejbjar srcdir="${build.classesdir}"
  1133. descriptordir="${src}">
  1134. &lt;iplanet destdir="${assemble.ejbjar}">
  1135. classpath="${ias.ejbc.cpath}" />
  1136. &lt;include name="**/*-ejb-jar.xml"/>
  1137. &lt;exclude name="**/*ias-*.xml"/>
  1138. &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
  1139. location="${ias.home}/APPS/ejb-jar_1_1.dtd"/>
  1140. &lt;dtd publicId="-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN"
  1141. location="${ias.home}/APPS/IASEjb_jar_1_0.dtd"/>
  1142. &lt;/ejbjar></pre>
  1143. </body>
  1144. </html>