Community
Participate
Working Groups
Numerous customers have reported the following issus as they migrate their development environment from products built upon eclispe 2.x (e.g. WSAD 5.1) to products built upon eclipse 3.x (e.g. RAD7). Using the default settings in the Ant launch config, running any J2EE Ant tasks (e.g. warExport) results in the following error: ======================================== BUILD FAILED C:\Program Files\IBM\SDP70\workspace_new\classifieds\build\build.xml:14: Could not create task or type of type: warExport. Ant could not find the task or a class this task relies upon. This is common and has a number of causes; the usual solutions are to read the manual pages then download and install needed JAR files, or fix the build file: - You have misspelt 'warExport'. Fix: check your spelling. - The task needs an external JAR file to execute and this is not found at the right place in the classpath. Fix: check the documentation for dependencies. Fix: declare the task. - The task is an Ant optional task and the JAR file and/or libraries implementing the functionality were not found at the time you yourself built your installation of Ant from the Ant sources. Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the task and make sure it contains more than merely a META-INF/MANIFEST.MF. If all it contains is the manifest, then rebuild Ant with the needed libraries present in ${ant.home}/lib/optional/ , or alternatively, download a pre-built release version from apache.org - The build file was written for a later version of Ant Fix: upgrade to at least the latest release version of Ant - The task is not an Ant core or optional task and needs to be declared using <taskdef>. - You are attempting to use a task defined using <presetdef> or <macrodef> but have spelt wrong or not defined it at the point of use Remember that for JAR files to be visible to Ant tasks implemented in ANT_HOME/lib, the files must be in the same directory or on the classpath Please neither file bug reports on this problem, nor email the Ant mailing lists, until all of these causes have been explored, as this is not an Ant bug. ======================================== This issue is caused by the change made in Bug 45899, which makes build in separate JRE the default setting. By switching to "Run in the same JRE as the workspace", the problem is resolved. But as you can see, the suggestions listed in the error log (if not misleading) does not really point the user to the right direction.
The error message itself is coming from Ant which does not know that it is embedded within Eclipse. An enhancement would be to potentially look for this type of build failure and attempt to append some Eclipse specific indication of what could be wrong.
Steven - is the workaround to this to add the appropriate jar to the Ant classpath so that Ant can find the task? Would it be possible for the tooling that requires J2EE to add the appropriate jar to the ant classpath using the org.eclipse.ant.core.extraClasspathEntries extension point?
My first comment was trying to solve the reason for the error message - however, on second look, it sounds like this bug report is asking for a better error message. As pointed out by Darin (S), the message is coming from Ant, which does not know about Eclipse. Nothing we can do for 3.3.1.
Darin, The workaround is to switch to "Run in the same JRE as the workspace". This bug is opened for a better error message, which can point the user to the correct *simple* workaround, rather than the current message which is not very helpful.
Has anything happened on this?
No work is planned for 3.4
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.