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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html lang="en">
  3. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  4. <head>
  5. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  6. <title>Apache Ant - Having Problems?</title>
  7. <link type="text/css" href="./page.css" rel="stylesheet">
  8. <meta name="author" content="Conor MacNeill">
  9. <meta name="email" content="">
  10. </head>
  11. <body>
  12. <p class="navpath">
  13. <script src="./breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  14. </p>
  15. <div class="logobar">
  16. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  17. <tr>
  18. <td align="left"><img border="0" alt="Apache Ant site" src="./images/group-logo.gif"></td>
  19. <td align="center" width="100%"><img alt="Apache Ant logo" border="0" src="./images/project-logo.gif"></td>
  20. <td align="right">
  21. <form target="_blank" onsubmit="q.value = query.value + ' site:ant.apache.org'" action="http://www.google.com/search" method="get">
  22. <table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F">
  23. <tr>
  24. <td colspan="3"><img height="10" width="1" alt="" src="./images/spacer.gif"></td>
  25. </tr>
  26. <tr>
  27. <td><img height="1" width="1" alt="" src="./images/spacer.gif"></td>
  28. <td nowrap="nowrap" class="searchcaption">
  29. <input name="q" type="hidden">
  30. <input size="15" id="query" type="text">
  31. <img height="1" width="5" alt="" src="./images/spacer.gif">
  32. <input name="Search" value="Search" type="submit">
  33. <br>
  34. the Apache Ant site
  35. </td>
  36. <td><img height="1" width="1" alt="" src="./images/spacer.gif"></td>
  37. </tr>
  38. <tr>
  39. <td><img alt="" border="0" height="10" width="9" src="./images/search-left.gif"></td>
  40. <td><img height="1" width="1" alt="" src="./images/spacer.gif"></td>
  41. <td><img alt="" border="0" height="10" width="9" src="./images/search-right.gif"></td>
  42. </tr>
  43. </table>
  44. </form>
  45. </td>
  46. </tr>
  47. </table>
  48. </div>
  49. <div class="tab">
  50. <table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
  51. <tr>
  52. <td width="8"><img alt="" height="5" width="8" src="./images/spacer.gif"></td><td valign="bottom">
  53. <table summary="selected tab" style="height: 1.5em" border="0" cellpadding="0" cellspacing="0">
  54. <tr>
  55. <td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="./images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b>Home</b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="./images/tabSel-right.gif"></td>
  56. </tr>
  57. </table>
  58. </td>
  59. <td width="5"><img alt="" height="8" width="8" src="./images/spacer.gif"></td><td valign="bottom">
  60. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  61. <tr>
  62. <td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="./images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="./projects/index.html"><font size="2" face="Arial, Helvetica, Sans-serif">Projects</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="./images/tab-right.gif"></td>
  63. </tr>
  64. </table>
  65. </td>
  66. </tr>
  67. </table>
  68. </div>
  69. <div class="bluebar"></div>
  70. <div class="menucontainer">
  71. <div align="center">
  72. <a href="http://ApacheCon.Com/"><img width="135" height="50"
  73. border="0" style="background-color: white"
  74. src="http://apache.org/images/ac2005eu_135x50.gif"
  75. alt="ApacheCon!" title="Come to ApacheCon!"/></a>
  76. </div>
  77. <div class="menu">
  78. <ul>
  79. <li class="menuheader">Apache Ant
  80. <ul>
  81. <li>
  82. <a href="./index.html">Welcome</a>
  83. </li>
  84. <li>
  85. <a href="./license.html">License</a>
  86. </li>
  87. <li>
  88. <a href="./antnews.html">News</a>
  89. </li>
  90. </ul>
  91. </li>
  92. <li class="menuheader">Documentation
  93. <ul>
  94. <li>
  95. <a href="./manual/index.html">Manual</a>
  96. </li>
  97. <li>
  98. <a href="./projects.html">Related Projects</a>
  99. </li>
  100. <li>
  101. <a href="./external.html">External Tools and Tasks</a>
  102. </li>
  103. <li>
  104. <a href="./resources.html">Resources</a>
  105. </li>
  106. <li>
  107. <a href="./faq.html">Frequently Asked Questions</a>
  108. </li>
  109. <li>
  110. <a href="http://wiki.apache.org/ant/FrontPage">Wiki</a>
  111. </li>
  112. <li>
  113. <span class="sel">Having Problems?</span>
  114. </li>
  115. </ul>
  116. </li>
  117. <li class="menuheader">Download
  118. <ul>
  119. <li>
  120. <a href="http://ant.apache.org/bindownload.cgi">Binary Distributions</a>
  121. </li>
  122. <li>
  123. <a href="http://ant.apache.org/srcdownload.cgi">Source Distributions</a>
  124. </li>
  125. </ul>
  126. </li>
  127. <li class="menuheader">Contributing
  128. <ul>
  129. <li>
  130. <a href="./mail.html">Mailing Lists</a>
  131. </li>
  132. <li>
  133. <a href="./cvs.html">CVS Repositories</a>
  134. </li>
  135. <li>
  136. <a href="http://issues.apache.org/bugzilla/enter_bug.cgi?product=Ant">Bug Database</a>
  137. </li>
  138. <li>
  139. <a href="http://issues.apache.org/bugzilla/enter_bug.cgi?product=Ant&amp;bug_severity=enhancement">Enhancement Requests</a>
  140. </li>
  141. <li>
  142. <a href="http://www.apache.org/foundation/contributing.html">Donations</a>
  143. </li>
  144. </ul>
  145. </li>
  146. <li class="menuheader">Project Management
  147. <ul>
  148. <li>
  149. <a href="./contributors.html">Contributors</a>
  150. </li>
  151. <li>
  152. <a href="./mission.html">Apache Ant Mission</a>
  153. </li>
  154. <li>
  155. <a href="./bylaws.html">Project Bylaws</a>
  156. </li>
  157. <li>
  158. <a href="./legal.html">Legal</a>
  159. </li>
  160. </ul>
  161. </li>
  162. </ul>
  163. </div>
  164. <img style="float: left" height="10" width="10" border="0" alt="" src="./images/menu-left.gif">
  165. <img style="float: right" height="10" width="10" border="0" alt="" src="./images/menu-right.gif">
  166. </div>
  167. <div class="lightbluebar">&nbsp;</div>
  168. <div class="main">
  169. <div class="content">
  170. <h1 class="title">Having Problems?</h1>
  171. <h3 class="section">
  172. <a name="Having Problems?"></a>
  173. Having Problems?
  174. </h3>
  175. <p>
  176. This page details some steps you can take to try and resolve
  177. any problems you may be having with Ant. If you find you can't
  178. resolve the problem, then this page will help you collect some of
  179. the relevant information to provide in a bug report. This information
  180. will help the Ant developers understand and resolve the problem.
  181. Of course, not all the steps here will make sense for every problem
  182. you may encounter - these are just some suggestions to point
  183. you in the right direction.
  184. </p>
  185. <h4 class="subsection">
  186. <a name="Ensure that you are actually running the version of Ant that you think you do"></a>
  187. Ensure that you are actually running the version of Ant that you think you do
  188. </h4>
  189. <p>Many tools include a version of Ant and some Operating
  190. Systems even install it by default now, so you may have a
  191. version of Ant installed that you haven't been aware of.</p>
  192. <p>One of the first things to do is to run
  193. <br /><br />
  194. <font face="verdana" size="-1">ant -version</font>
  195. <br /><br />
  196. and
  197. <br /><br />
  198. <font face="verdana" size="-1">ant -diagnostics</font>
  199. <br /><br />
  200. to be sure. Also, we highly recommend that you run Ant with
  201. an empty CLASSPATH. If any other version of Ant can be
  202. loaded from the CLASSPATH, many types of errors may happen
  203. because of incompatible classes being loaded.</p>
  204. <p>See <a href="faq.html">the FAQ</a> for <a href="faq.html#NoClassDefFoundError">some</a> <a href="faq.html#InstantiationException">examples</a>, but many
  205. other problems are a result of an old version of Ant on your
  206. system as well.</p>
  207. <h4 class="subsection">
  208. <a name="Read the Manual"></a>
  209. Read the Manual
  210. </h4>
  211. <p>
  212. The first step to take when you have a problem with Ant is to read
  213. the <a href="manual/index.html">manual</a> entry for the task or
  214. concept that is giving you trouble. In particular, check the
  215. meaning of a task's attributes and nested elements. Perhaps an
  216. attribute is available that would provide the behavior you require.
  217. If you have problems with the manual itself, you can submit a
  218. documentation bug report (see below) to help us improve the Ant
  219. documentation.
  220. </p>
  221. <h4 class="subsection">
  222. <a name="Examine Debug Output"></a>
  223. Examine Debug Output
  224. </h4>
  225. <p>
  226. If you're still having a problem, the next step is to try and
  227. gather additional information about what Ant is doing.
  228. Try running Ant with the <code>verbose</code> flag:
  229. <br /><br />
  230. <font face="verdana" size="-1">ant -verbose</font>
  231. <br /><br />
  232. or
  233. <br /><br />
  234. <font face="verdana" size="-1">ant -v</font>
  235. <br /><br />
  236. This will produce output that starts like the following:</p>
  237. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  238. <tr>
  239. <td colspan="1" rowspan="1"
  240. valign="top" align="left">
  241. Ant version 1.4.1 compiled on October 11 2001<br />
  242. Buildfile: build.xml<br />
  243. Detected Java version: 1.3 in: D:\usr\local\java\jdk13\jre<br />
  244. Detected OS: Windows NT<br />
  245. parsing buildfile D:\ant\build.xml
  246. with URI = file:D:/ant/build.xml<br />
  247. Project base dir set to: D:\ant<br />
  248. ��[property] Loading Environment env.<br />
  249. ��[property] Loading D:\ant\conf.properties<br />
  250. Build sequence for target 'debug' is [debug]<br />
  251. Complete build sequence is [debug, gensrc, compile, jar, test]<br />
  252. . . .<br />
  253. </td>
  254. </tr>
  255. </table>
  256. <p>
  257. You should be able to see from the trace more about what Ant
  258. is doing and why it's taking a particular course of action.
  259. If you need even more information, you can use the
  260. <code>-debug</code> flag rather than
  261. <code>-verbose</code>.
  262. This will generally produce so much
  263. output that you may want to save the output to a file and
  264. analyze it in an editor. You can save the output using the
  265. <code>-logfile &lt;filename&gt;</code> flag, or
  266. using redirection.
  267. </p>
  268. <p>
  269. Once you have all this debug information, how can you use it
  270. to solve your problem? That will depend on the task in question
  271. and the nature of your problem. Each task logs different aspects
  272. of its operation, but it should give you an idea of what is going
  273. on. For example, the <code>&lt;javac&gt;</code> task logs the
  274. reasons why it
  275. chooses to compile particular class files and not others, along
  276. with which compiler it is using and the arguments it will pass
  277. to that compiler. The following partial trace shows why
  278. <code>&lt;javac&gt;</code> is adding one class file but
  279. skipping another.
  280. This is followed by which compiler it will be using, the
  281. arguments that will get passed to the compiler,
  282. and a list of all the class files to be compiled.
  283. </p>
  284. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  285. <tr>
  286. <td colspan="1" rowspan="1"
  287. valign="top" align="left">
  288. [javac] Test.java omitted as D:\classes\Test.class is up to date.<br />
  289. [javac] Unset.java added as D:\classes\Unset.class is outdated.<br />
  290. [javac] Compiling 1 source file to D:\classes<br />
  291. [javac] Using classic compiler<br />
  292. [javac] Compilation args: -d D:\classes -classpath D:\classes;<br />
  293. D:\jdk118\classes.zip; -sourcepath D:\src\java -g:none<br />
  294. [javac] File to be compiled:<br />
  295. D:\src\java\Unset.java<br />
  296. </td>
  297. </tr>
  298. </table>
  299. <p>
  300. In many cases, Ant tasks are wrappers around OS commands or
  301. other Java classes. In debug mode, many of these tasks will
  302. print out the equivalent command line, as the
  303. <code>&lt;javac&gt;</code> task
  304. output does. If you are having a problem, it is often useful to
  305. run the command directly from the command line, in the same way
  306. Ant is running it, and see if the problem occurs from there
  307. as well. The problem may be in the command that is being run,
  308. or it may be in the way the Ant task is running the command.
  309. You can also see the effect of changing attribute values on the
  310. generated command line. This can help you to understand whether
  311. you are using the correct attributes and values.
  312. </p>
  313. <h4 class="subsection">
  314. <a name="Has It Been Fixed?"></a>
  315. Has It Been Fixed?
  316. </h4>
  317. <p>
  318. After examining the debug output, if you still believe that the
  319. problem you are having is caused by Ant, chances are that someone
  320. else may have already encountered this problem, and perhaps it has
  321. been fixed. The next step, therefore, may be to try a nightly build
  322. of Ant to see if the problem has been fixed. <!--Nightly builds for Ant
  323. are available from the
  324. <a href="http://brutus.apache.org/~nightlybuild/builds/ant/">
  325. Ant web site</a>.--> While Ant nightly builds are typically quite
  326. stable and are used by
  327. <a href="http://brutus.apache.org/gump/public/">Gump</a>
  328. to build many other Jakarta projects, these builds should
  329. nonetheless be treated as experimental. Note that nightly builds
  330. do not build many of the optional tasks the come with Ant.
  331. A snapshot of these optional tasks is occasionally uploaded to
  332. the nightly download
  333. <a href="http://cvs.apache.org/builds/ant/nightly/optional/">
  334. area</a>. However, even this snapshot does not contain every
  335. optional task.
  336. </p>
  337. <h4 class="subsection">
  338. <a name="Has It Been Reported?"></a>
  339. Has It Been Reported?
  340. </h4>
  341. <p>
  342. If the current nightly build doesn't resolve your problem, it is
  343. possible that someone else has reported the issue. It is time to
  344. look at the <a href="http://issues.apache.org/bugzilla/">
  345. Apache Bug Database</a>. This system is easy to use, and it will
  346. let you search the <a href="http://issues.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">
  347. currently open</a> and resolved bugs to see if your problem has
  348. already been reported. If your problem has been reported, you can
  349. see whether any of the developers have commented, suggesting
  350. workarounds, or the reason for the bug, etc. Or you may have
  351. information to add (see about creating and modifying bug reports
  352. below), in which case, go right ahead and add the information.
  353. If you don't have any additional information, you may just want
  354. to vote for this bug, and perhaps
  355. add yourself to the <code>CC</code> list to follow the progress
  356. of this bug.
  357. </p>
  358. <h4 class="subsection">
  359. <a name="Filing a Bug Report"></a>
  360. Filing a Bug Report
  361. </h4>
  362. <p>
  363. By this time, you may have decided that there is an unreported
  364. bug in Ant. You have a few choices at this point. You can send
  365. an email to the <code>user</code> mailing list
  366. to see if
  367. others have encountered your issue and find out how they may
  368. have worked around it. If after some discussion, you feel it
  369. is time to create
  370. a bug report, this is a simple operation in the bug database.
  371. Please try to provide as much information as possible in order
  372. to assist the developers in resolving the bug. Please try to enter
  373. correct values for the various inputs when creating the bug, such
  374. as which version of Ant you are running, and on which platform,
  375. etc. Once the bug is created, you can also add attachments to
  376. the bug report.
  377. </p>
  378. <p>
  379. What information should you include in your bug report? The
  380. easiest bugs to fix are those that are most easily reproducible,
  381. so it is really helpful if you can produce a small test case that
  382. exhibits the problem. In this case, you would attach the build file
  383. and any other files necessary to reproduce the problem, probably
  384. packed together in an archive. If you can't produce a test case,
  385. you should try to include a snippet from your build file and the
  386. relevant sections from the verbose or debug output from Ant. Try
  387. to include the header information where Ant states the version,
  388. the OS and VM information, etc. As debug output is likely to be
  389. very large, it's best to remove any output that is not
  390. relevant. Once the bug is entered into the bug database, you
  391. will be kept informed by email about progress on the bug. If
  392. you receive email asking for further information, please try to
  393. respond, as it will aid in the resolution of your bug.
  394. </p>
  395. <h4 class="subsection">
  396. <a name="Asking for an Enhancement"></a>
  397. Asking for an Enhancement
  398. </h4>
  399. <p>
  400. Sometimes, you may find that Ant just doesn't do what you need it
  401. to. It isn't a bug, as such, since Ant is working the way it is
  402. supposed to work. Perhaps it is some additional functionality for
  403. a task that hasn't been thought of yet, or maybe a completely new
  404. task. For these situations, you will
  405. want to raise an <i>enhancement request</i>. Enhancement requests
  406. are managed using the same Apache Bug Database described above.
  407. These are just a different type of bug report. If you look in the
  408. bug database, you will see that one of the severity settings for
  409. a bug is "Enhancement". Just fill the bug report in,
  410. set the severity of the bug to "Enhancement", and
  411. state in the description how you would like to have Ant enhanced.
  412. Again, you should first check whether there are any existing
  413. enhancment requests that cover your needs. If so, just add your
  414. vote to these.
  415. </p>
  416. <h4 class="subsection">
  417. <a name="Fixing the Bug"></a>
  418. Fixing the Bug
  419. </h4>
  420. <p>
  421. If you aren't satisfied with just filing a bug report, you can
  422. try to find the cause of the problem and provide a fix yourself.
  423. The best way to do that is by working with the latest code from CVS.
  424. Alternatively, you can work with the source code available from the
  425. <a href="http://ant.apache.org/srcdownload.cgi">
  426. source distributions</a>. If you
  427. are going to tackle the problem at this level, you may want to
  428. discuss some details first on the <code>dev</code>
  429. mailing list. Once you have a fix for the problem, you may submit
  430. the fix as a <i>patch</i> to either the
  431. <code>dev</code> mailing
  432. list, or enter the bug database as described above and attach the
  433. patch to the bug report. Using the bug database has the advantage
  434. of being able to track the progress of your patch.
  435. </p>
  436. <p>
  437. If you have a patch to submit and are sending it to the
  438. <code>dev</code> mailing list,
  439. prefix "[PATCH]"
  440. to your message subject. Please include any relevant bug numbers.
  441. Patch files should be created with the <code>-u</code>
  442. option of the
  443. <code>diff</code> or <code>cvs diff</code> command. For
  444. example:<br /><br />
  445. <font face="verdana" size="-1">
  446. diff -u Javac.java.orig Javac.java &gt; javac.diffs<br /><br />
  447. </font>
  448. or, if you have source from CVS:<br /><br />
  449. <font face="verdana" size="-1">
  450. cvs diff -u Javac.java &gt; javac.diffs<br /><br />
  451. </font>
  452. Note: You should give your patch files meaningful names.
  453. This makes it easier for developers who need to apply a number
  454. of different patch files.
  455. </p>
  456. </div>
  457. </div>
  458. <p class="copyright">
  459. Copyright &copy; 2000-2005&nbsp;The Apache Software Foundation. All rights reserved.
  460. <script type="text/javascript" language="JavaScript"><!--
  461. document.write(" - "+"Last Published: " + document.lastModified);
  462. // -->
  463. </script>
  464. </p>
  465. </body>
  466. </html>