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.

problems.html 20 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- Content Stylesheet for Site -->
  3. <!-- start the processing -->
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  7. <meta name="author" value="Conor MacNeill">
  8. <meta name="email" value="conor@apache.org">
  9. <title>Apache Ant - Having Problems?</title>
  10. </head>
  11. <body bgcolor="#ffffff" text="#000000" link="#525D76">
  12. <table border="0" width="100%" cellspacing="0">
  13. <!-- TOP IMAGE -->
  14. <tr>
  15. <td align="left">
  16. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
  17. </td>
  18. <td align="right">
  19. <a href="http://jakarta.apache.org/ant/"><img src="./artwork/ant_logo_large.gif" alt="Apache Ant" border="0"/></a>
  20. </td>
  21. </tr>
  22. </table>
  23. <table border="0" width="100%" cellspacing="4">
  24. <tr><td colspan="2">
  25. <hr noshade="" size="1"/>
  26. </td></tr>
  27. <tr>
  28. <!-- LEFT SIDE NAVIGATION -->
  29. <td valign="top" nowrap="true">
  30. <p><strong>Apache Ant</strong></p>
  31. <ul>
  32. <li> <a href="./index.html">Front Page</a>
  33. </li>
  34. <li> <a href="./antnews.html">News</a>
  35. </li>
  36. <li> <a href="./manual/index.html">Documentation</a>
  37. </li>
  38. <li> <a href="./projects.html">Related Projects</a>
  39. </li>
  40. <li> <a href="./external.html">External Tools and Tasks</a>
  41. </li>
  42. <li> <a href="./resources.html">Resources</a>
  43. </li>
  44. <li> <a href="./faq.html">Ant FAQ</a>
  45. </li>
  46. <li> <a href="./problems.html">Having Problems?</a>
  47. </li>
  48. </ul>
  49. <p><strong>Download</strong></p>
  50. <ul>
  51. <li> <a href="http://jakarta.apache.org/site/binindex.html">Binaries</a>
  52. </li>
  53. <li> <a href="http://jakarta.apache.org/site/sourceindex.html">Source Code</a>
  54. </li>
  55. </ul>
  56. <p><strong>Jakarta</strong></p>
  57. <ul>
  58. <li> <a href="http://jakarta.apache.org/site/news.html">News & Status</a>
  59. </li>
  60. <li> <a href="http://jakarta.apache.org/site/mission.html">Mission</a>
  61. </li>
  62. <li> <a href="http://jakarta.apache.org/site/guidelines.html">Guidelines Notes</a>
  63. </li>
  64. <li> <a href="http://jakarta.apache.org/site/faqs.html">FAQs</a>
  65. </li>
  66. </ul>
  67. <p><strong>Get Involved</strong></p>
  68. <ul>
  69. <li> <a href="http://jakarta.apache.org/site/getinvolved.html">Overview</a>
  70. </li>
  71. <li> <a href="http://jakarta.apache.org/site/cvsindex.html">CVS Repositories</a>
  72. </li>
  73. <li> <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
  74. </li>
  75. <li> <a href="http://jakarta.apache.org/site/library.html">Reference Library</a>
  76. </li>
  77. <li> <a href="http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Ant">Bug Database</a>
  78. </li>
  79. <li> <a href="http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Ant&bug_severity=Enhancement">Enhancement Requests</a>
  80. </li>
  81. </ul>
  82. </td>
  83. <td align="left" valign="top">
  84. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  85. <tr><td bgcolor="#525D76">
  86. <font color="#ffffff" face="arial,helvetica,sanserif">
  87. <a name="Having Problems?"><strong>Having Problems?</strong></a>
  88. </font>
  89. </td></tr>
  90. <tr><td>
  91. <blockquote>
  92. <p>If you are having problems with Ant, this page details some steps you can take
  93. to try and resolve the problem. If you can't resolve the problem then this page will help
  94. you collect some of the relevant information to provide a bug report. This information will help
  95. the Ant developers understand and resolve the problem. Of course, not all of the steps here will
  96. make sense for every problem you encounter. These are just some suggestions to
  97. point you in the right direction.
  98. </p>
  99. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  100. <tr><td bgcolor="#828DA6">
  101. <font color="#ffffff" face="arial,helvetica,sanserif">
  102. <a name="Read the Manual"><strong>Read the Manual</strong></a>
  103. </font>
  104. </td></tr>
  105. <tr><td>
  106. <blockquote>
  107. <p>The first step to take when you have a problem is to read the <a href="manual/index.html">
  108. manual</a> entry for the task or concept that is giving you trouble. Check particularly the meaning of
  109. attributes and nested elements. Perhaps an attribute would provide the behavior you require. If you
  110. have problems with the manual, then you can submit a documentation bug report (see below) to help us
  111. improve the Ant documentation.
  112. </p>
  113. </blockquote>
  114. </td></tr>
  115. </table>
  116. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  117. <tr><td bgcolor="#828DA6">
  118. <font color="#ffffff" face="arial,helvetica,sanserif">
  119. <a name="Examine Debug Output"><strong>Examine Debug Output</strong></a>
  120. </font>
  121. </td></tr>
  122. <tr><td>
  123. <blockquote>
  124. <p>The first step when you have a problem is to see what Ant is doing. Try running Ant with
  125. The verbose flag<br /><br />
  126. <code>ant -verbose</code><br /><br />
  127. or<br /><br />
  128. <code>ant -v</code><br /><br />
  129. This will produce something which starts like the following:</p>
  130. <div align="left">
  131. <table cellspacing="4" cellpadding="0" border="0">
  132. <tr>
  133. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  134. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  135. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  136. </tr>
  137. <tr>
  138. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  139. <td bgcolor="#ffffff"><pre>
  140. Ant version 1.4alpha compiled on August 6 2001
  141. Buildfile: build.xml
  142. Detected Java version: 1.3 in: f:\jdk1.3\jre
  143. Detected OS: Windows NT
  144. parsing buildfile \jakarta-ant\build.xml with
  145. URI = file:/jakarta-ant/build.xml
  146. Project base dir set to: \jakarta-ant
  147. [property] Loading \jakarta-ant\.ant.properties
  148. [property] Unable to find property file: \jakarta-ant\.ant.properties
  149. [property] Loading \conor\.ant.properties
  150. [property] Override ignored for debug
  151. prepare:
  152. check_for_optional_packages:
  153. ...
  154. </pre></td>
  155. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  156. </tr>
  157. <tr>
  158. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  159. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  160. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  161. </tr>
  162. </table>
  163. </div>
  164. <p>
  165. You may be able to see in this trace what ant is doing and why it takes a particular
  166. course of action. If you need even more information you can use the <code>-debug</code>
  167. flag rather than <code>-verbose</code>. This will generally produce so much output that
  168. you may want to save the output and analyze it in an editor.
  169. </p>
  170. <p>So, once you have all this debug information, how can you use it to solve your problem?
  171. That will depend on the task in question and the nature of your problem. Each task logs
  172. different aspects of its operation, but it will give you an idea of what is going on. For
  173. example, the &lt;javac&gt; task logs the reasons why it chooses to compile particular
  174. classes and the equivalent command it is using. The following trace (which has been edited
  175. and reformatted for clarity) shows javac adding one class but skipping another. This is followed
  176. by the compiler arguments and a summary of all the classes to be compiled.
  177. </p>
  178. <div align="left">
  179. <table cellspacing="4" cellpadding="0" border="0">
  180. <tr>
  181. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  182. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  183. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  184. </tr>
  185. <tr>
  186. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  187. <td bgcolor="#ffffff"><pre>
  188. [javac] org\apache\tools\ant\listener\Log4jListener.java added as
  189. \build\classes\org\apache\tools\ant\listener\Log4jListener.class
  190. is outdated.
  191. [javac] org\apache\tools\ant\Location.java omitted as
  192. \build\classes\org\apache\tools\ant\Location.class is up to date.
  193. ...
  194. [javac] Compiling 1 source file to \jakarta-ant\build\classes
  195. [javac] Using modern compiler
  196. [javac] Compilation args: -d \jakarta-ant\build\classes -classpath
  197. \jakarta-ant\build\classes;F:\jdk1.3\lib\tools.jar;
  198. \Ant\lib\optional.jar;\Ant\lib\log4j.jar;
  199. \Ant\lib\junit.jar;\Ant\lib\jaxp.jar;
  200. \Ant\lib\crimson.jar;\Ant\lib\ant.jar
  201. -sourcepath \jakarta-ant\src\main -g:none -O
  202. [javac] File to be compiled:
  203. \src\main\org\apache\tools\ant\listener\Log4jListener.java
  204. </pre></td>
  205. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  206. </tr>
  207. <tr>
  208. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  209. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  210. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  211. </tr>
  212. </table>
  213. </div>
  214. <p>
  215. In many cases Ant tasks are wrappers around OS commands or other java classes. In debug mode, many
  216. of these tasks will print out the equivalent command line, as the &lt;javac&gt; task above does. If
  217. you are having a problem, it is often useful to run the command directly in the same way Ant is doing
  218. and see if the problem persists. The problem may lie in the command being run by Ant, or in the way
  219. the Ant task is running the command. You can also see the effect of changing attribute values on the
  220. generated command line. This can help you to understand whether you are using the correct attributes
  221. and values.
  222. </p>
  223. </blockquote>
  224. </td></tr>
  225. </table>
  226. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  227. <tr><td bgcolor="#828DA6">
  228. <font color="#ffffff" face="arial,helvetica,sanserif">
  229. <a name="Has it been fixed?"><strong>Has it been fixed?</strong></a>
  230. </font>
  231. </td></tr>
  232. <tr><td>
  233. <blockquote>
  234. <p>
  235. After examining the debug output, you still believe that the problem you are having may be caused by Ant.
  236. Chances are that someone else may have already encountered this problem and perhaps it has been
  237. fixed. The next step, therefore, may be to try a nightly build of Ant to see if the
  238. problem has been fixed. Nightly builds for Ant are available from the
  239. <a href="http://www.apache.org/dist/jakarta/jakarta-ant/nightly/">Jakarta web site</a>. While Ant nightly
  240. builds are typically quite stable and are used by <a href="http://www.apache.org/dist/jakarta/gump/latest/">
  241. Gump</a> to build many other Jakarta projects, these builds should be treated as experimental. You can
  242. install and verify whether your problem has been fixed. Note that nightly builds do not build many of the
  243. optional tasks the come with Ant. A snapshot of these optional tasks is occasionally uploaded to the nightly
  244. download <a href="http://www.apache.org/dist/jakarta/jakarta-ant/nightly/optional/">area</a>. Note that even
  245. this snapshot does not contain every optional task.
  246. </p>
  247. </blockquote>
  248. </td></tr>
  249. </table>
  250. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  251. <tr><td bgcolor="#828DA6">
  252. <font color="#ffffff" face="arial,helvetica,sanserif">
  253. <a name="Has it been reported?"><strong>Has it been reported?</strong></a>
  254. </font>
  255. </td></tr>
  256. <tr><td>
  257. <blockquote>
  258. <p>
  259. If the current nightly build doesn't resolve your problem, it is possible that someone else has reported
  260. the issue. It is time to look at the <a href="http://nagoya.apache.org/bugzilla/">Apache Bug Database</a>.
  261. This system is easy to use and it will let you search the
  262. <a href="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=Ant&amp;short_desc=&amp;short_desc_type=substring&amp;long_desc=&amp;long_desc_type=substring&amp;bug_file_loc=&amp;bug_file_loc_type=substring&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.bug_id">
  263. currently open
  264. </a>.
  265. and resolved bugs to see if your problem has already been reported.
  266. If your problem has been reported, you can see whether any of the developers have commented,
  267. suggesting workarounds or the reason for the bug, etc. You may have more information to add (see about
  268. creating bug reports below), in which case, go right ahead and add it. If you can't add more information
  269. you may just want to vote for this bug, and perhaps add yourself to the CC list to follow the progress of
  270. this bug.
  271. </p>
  272. </blockquote>
  273. </td></tr>
  274. </table>
  275. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  276. <tr><td bgcolor="#828DA6">
  277. <font color="#ffffff" face="arial,helvetica,sanserif">
  278. <a name="Filing a Bug report"><strong>Filing a Bug report</strong></a>
  279. </font>
  280. </td></tr>
  281. <tr><td>
  282. <blockquote>
  283. <p>By this time you may have decided that there is a bug in Ant. You have a few choices at this
  284. point. You can send an email to the ant-user mailing list to see if others have encountered your issue
  285. and how they may have worked around it. If after some discussion, you still feel you have a bug, it
  286. is time to create a bug report. This is a simple operation in the Bug Database. Please try to provide
  287. as much information as possible to assist the developers in resolving the bug. Please try to enter correct
  288. values for the various inputs when creating the bug. Once the bug is created you can add attachments to
  289. the bug report.
  290. </p>
  291. <p>What information should you include in your bug report? The easiest bugs to fix are those which are most
  292. easily reproducible, so if you can, it is really helpful to produce a small test case that exhibits the
  293. problem. In this case, you would attach the build file and other files necessary to reproduce the problem
  294. probably packed together in an archive. If you can't produce a test case, you should try to include a
  295. snippet from your build file and the relevant sections from the debug out from Ant. Try to include the
  296. header information where Ant states the version, the OS and VM information etc. As the debug output is
  297. likely to be very large, you should try to remove the output which is not relevant. Once the bug is
  298. entered into the Bug Database, you will be kept informed about progress on the bug. If you receive email
  299. asking for further information, please try to respond as it will aid in the resolution of your bug.
  300. </p>
  301. </blockquote>
  302. </td></tr>
  303. </table>
  304. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  305. <tr><td bgcolor="#828DA6">
  306. <font color="#ffffff" face="arial,helvetica,sanserif">
  307. <a name="Asking for an enhancement"><strong>Asking for an enhancement</strong></a>
  308. </font>
  309. </td></tr>
  310. <tr><td>
  311. <blockquote>
  312. <p>Sometimes, you may find that Ant just doesn't do what you want. It isn't a bug, as such, since Ant
  313. is working the way it is supposed to. Perhaps it is something that hasn't been thought of yet, or
  314. a completely new task. For these situations you will want to raise an enhancement request.
  315. Enhancement requests are managed using the same Apache Bug Database described above.
  316. These are just a different type of report. If you look in the database, you will see that one of
  317. the severity settings for a bug is "Enhancement". So, just fill the bug report in, and
  318. in the description, state how you would like to have Ant enhanced. Again you should check whether
  319. there are any existing enhancment requests that cover your needs. If so, just add your vote to these.
  320. </p>
  321. </blockquote>
  322. </td></tr>
  323. </table>
  324. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  325. <tr><td bgcolor="#828DA6">
  326. <font color="#ffffff" face="arial,helvetica,sanserif">
  327. <a name="Fixing the Bug"><strong>Fixing the Bug</strong></a>
  328. </font>
  329. </td></tr>
  330. <tr><td>
  331. <blockquote>
  332. <p>If you aren't satisfied just filing a bug report, you can try to find and fix the problem yourself. The
  333. best way to do that is by working against the latest code from CVS. Alternatively, you can work with the
  334. source code from the source distributions available on the Jakarta website. If you are going to tackle the
  335. issues at this level, you may want to discuss details on the ant-dev mailing list. Once you have a fix
  336. for the problem, you may either submit the patch to the ant-dev mailing list or enter into the Bug
  337. Database as described above, attaching the patch. Using the Bug database has the advantage of tracking
  338. the progress of your bug.
  339. </p>
  340. </blockquote>
  341. </td></tr>
  342. </table>
  343. </blockquote>
  344. </td></tr>
  345. </table>
  346. </td>
  347. </tr>
  348. <!-- FOOTER -->
  349. <tr><td colspan="2">
  350. <hr noshade="" size="1"/>
  351. </td></tr>
  352. <tr><td colspan="2">
  353. <div align="center"><font color="#525D76" size="-1"><em>
  354. Copyright &#169; 2000-2002, Apache Software Foundation
  355. </em></font></div>
  356. </td></tr>
  357. </table>
  358. </body>
  359. </html>
  360. <!-- end the processing -->