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

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