• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Ant/Cactus classpath problems

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I'm trying to run some tests on a cactified WAR file, using Ant to trigger Cactus to do the job. I'm having some problems with NoClassDefFound errors. When I set the <cactus> task's "fork" attribute to "yes", Ant cannot see the "xml-apis.jar", which it should be using to format the XML reports of the test results, despite that jar being in the ant/lib directory alongside ant.jar itself, and also being on the classpath of the <taskdef> for the <cactus> tasks. I have opened up this jar to check that the particular class that is not being found, "org.w3c.dom.Node", is there, and it is.
If I set the <cactus> task's "fork" attribute to "no", an XML report is produced, but my tests fail at the first hurdle because classes that were added to the WAR file during "cactification" cannot be found. I have opened up the cactified WAR file to check that those classes are present, and they are. In an ideal world, I would like to have "fork" set to "yes" so that my tests can't interfere with each other.
I'm obviously missing some classpath issue here. Can anyone help?
 
Paul A Green
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Again,
OK, i've cracked it, so I thought i'd better say so before anyone wastes their time thinking about it. Apologies to anyone who already has. It was a bit of a schoolboy error (do people outside the UK use that expression?) by me, i'm ashamed to say. The tests I was trying to run using Cactus had originally been vanilla JUnit tests. In Changing over to Cactus, I had forgotten to have my test classes extend Cactus' "ServletTestCase" instead of JUnit's "TestCase". Still, I guess that's the "experience" they mean when they say "salary according to experience".
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic