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

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