Problem running cactus from ant
"Dickinson, Ian J. \(HP Labs, Bristol, UK\)" <[email protected]>
| Newsgroups | gmane.comp.jakarta.cactus.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm just getting going with using Cactus to test a J2EE project. I've
built my cactified .war and deployed the .ear. I can run a simple test
successfully using the ServletRunner on the server, but if I try to
invoke the same test from the cactus task in ant, I get a
ClassNotFoundException:
Buildfile: c:\home\ijd\projects2\vrmm-apps-phm\build.xml
run-cactus:
[cactus]
-----------------------------------------------------------------
[cactus] Running tests against JBossGeneric @ http://localhost:8088
[cactus]
-----------------------------------------------------------------
[cactus] Running com.hp.vrmm.station.StationInfoFacadeBeanTest
[cactus] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[cactus] Testsuite: com.hp.vrmm.station.StationInfoFacadeBeanTest
[cactus] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[cactus] Caused an ERROR
[cactus] com.hp.vrmm.station.StationInfoFacadeBeanTest
[cactus] java.lang.ClassNotFoundException:
com.hp.vrmm.station.StationInfoFacadeBeanTest
[cactus] at java.net.URLClassLoader$1.run(Unknown Source)
[cactus] at java.security.AccessController.doPrivileged(Native
Method)
[cactus] at java.net.URLClassLoader.findClass(Unknown Source)
[cactus] at java.lang.ClassLoader.loadClass(Unknown Source)
[cactus] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown
Source)
[cactus] at java.lang.ClassLoader.loadClass(Unknown Source)
[cactus] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[cactus] at java.lang.Class.forName0(Native Method)
[cactus] at java.lang.Class.forName(Unknown Source)
BUILD FAILED
C:\home\ijd\projects2\vrmm-apps-phm\build.xml:61: Test
com.hp.vrmm.station.StationInfoFacadeBeanTest failed
Total time: 2 seconds
The named class is present under WEB-INF/classes in the cactified .war,
and, indeed, is invoked from the servlet test runner. My cactus task
looks like this:
<target name="run-cactus">
<cactus earfile="${build.dir}/test-${ear.name}" fork="yes"
printsummary="yes" haltonerror="true"
haltonfailure="false">
<containerset>
<generic name="JBossGeneric" port="8088">
<startup target="generic.jboss.deploy"/>
<shutdown target="generic.jboss.undeploy"/>
</generic>
</containerset>
<formatter type="plain" usefile="false"/>
<test name="com.hp.vrmm.station.StationInfoFacadeBeanTest" />
</cactus>
</target>
Following the advice of another posting on this list, I'm using a
generic server description to deploy to JBoss 4.0.3SP1. The rest of my
environment is: Ant 1.6.5, jakarta-cactus-13-1.7.2 and JDK 1.5.0-06.
Any suggestions would be much appreciated!
Thanks,
Ian
________________________________________________________________________
_
Ian Dickinson HP Labs, Bristol, UK Semantic & Adaptive Systems
Dept
http://www.hpl.hp.com/people/Ian_Dickinson
mailto:[email protected]