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

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