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

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