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

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