I tried to run an ant script that compiles my project and runs junit cases, and create test reports. The script runs fine as long as I dont use ant's "junitreport" task. When I use it, I get this error - "BUILD FAILED: java.lang.VerifyError: (class: org/apache/xerces/parsers/IntegratedParserConfiguration, method: configurePipeline signature: ()V) Incompatible type for getting or setting field" I've copied the xalan.jar file into ant's lib folder. So the script runs fine if I dont use eclipse (just run ant in command line). I've also changed the ANT_HOME in eclipse to point to this folder. Still no luck. Please help.
Thanks<br />Karthik<br />SCJP 1.4, CCNA.<br /> <br />"Success is relative. More the success, more the relatives."
Make sure ant and eclipse are using the same versions of jar files. If there is a conflict, eclipse is usually the picky one, so copy the jar file from the eclipse distribution
Make sure you set the "output folder" for eclipse compilations to be different to the directory where ant places its compiled class files. Both like to think they do incremental compilation, and can get confused if you do both. Right click your project in the package explorer and select "properties", then choose "Java build Path" and set the "Default Output Folder" to somewhere ant doesn't care about.
Set up ant tasks using
Run >> External Tools >> External Tools I've found it wise to set up a separate task for each group of targets I commonly use (clean,build), (deploy), etc.
Make sure you tell eclipse about any jars your build script needs from ant/lib. Be wary of just adding everything from that directory (see 1, above). Each time you add a jar, run your ant script again from eclipse to see if it has everything it needs. menu: Windows >> Preferences
Select Ant >> Runtime Click the "Add jars" button to add jars. Note that the "Add Folder" option is for directories of classes, so adding the ant/lib folder is unlikely to be any use, you need to add all the jars you use individually.
Remember that you can click the "man with red box" icon (?) to re-run the most recently reused external command, whch includes Ant scripts.
I hope some of the above has been helpful. [ July 02, 2003: Message edited by: Frank Carver ]
Originally posted by Frank Carver: Make sure you set the "output folder" for eclipse compilations to be different to the directory where ant places its compiled class files. Both like to think they do incremental compilation, and can get confused if you do both.
Unless you want to use Ant to *complement* Eclipse (code generation, RMI compiling and similar things), of course...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Frank Carver: This is a symptom of a well-known incompatibility. The trick is to copy the XML jar files from the eclipse distribution to the ant lib, so that both systems use the same versions.
I just happened to run into this same problem today running an Ant script from wsad 5, which is also using Eclipse. I hadn't run into this problem before. Is this problem documented somewhere?
The problem has been mentioned on several archived mailing lists and bulletin boards. Now it's mentioned here too! Unfortunately it's one of those problems which is hard to search for unless you have an idea what the problem is in the first place. Try google for "eclipse incompatible xerces" or something like that.
I have been having the same problems with 2.1 and ANT 1.5.3. I have copied the xerces jar files that come with eclipse into the ANT lib. Set the preferences to use my ANT_HOME dir (which properly grabs all the jars in the ANT lib dir) but am still having the same problem. Any ideas? Thanks, Phil