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 63 kB

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