NoClassDefFoundError when hudson runs a maven project -
i have project running tests. it's maven project uses selenium. runs correctly when launched locally, hudson platform, throws noclassdeffounderror:
parsing poms [elsevier-selenium] $ "c:\program files\java\jdk1.7.0_25/bin/java" -xmx1024m -cp e:\hudson\plugins\maven-plugin\web-inf\lib\maven-agent-1.353.jar;e:\maven\boot\classworlds-1.1.jar hudson.maven.agent.main e:\maven e:\hudson\war\web-inf\lib\remoting-1.353.jar e:\hudson\plugins\maven-plugin\web-inf\lib\maven-interceptor-1.353.jar 1753 e:\hudson\plugins\maven-plugin\web-inf\lib\maven2.1-interceptor-1.2.jar <===[hudson remoting capacity]===>channel started executing maven: -b -f e:\hudson\jobs\tests-selenium\workspace\elsevier-selenium\pom.xml integration-test [info] scanning projects... [info] ------------------------------------------------------------------------ [info] building selenium-elsevier [info] task-segment: [integration-test] [info] ------------------------------------------------------------------------ [info] [compiler:testcompile {execution: default}] [info] changes detected - recompiling module! [info] compiling 5 source files e:\hudson\jobs\tests-selenium\workspace\elsevier-selenium\target\test-classes [info] [site:attach-descriptor {execution: default-attach-descriptor}] [info] [failsafe:integration-test {execution: default}] [info] failsafe report directory: e:\hudson\jobs\tests-selenium\workspace\elsevier-selenium\target\failsafe-reports ------------------------------------------------------- t e s t s ------------------------------------------------------- ------------------------------------------------------- t e s t s ------------------------------------------------------- running fr.elsevier.tests.disponibilite.searchtest tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0.203 sec <<< failure! fr.elsevier.tests.disponibilite.searchtest time elapsed: 0.203 sec <<< error! java.lang.noclassdeffounderror: not initialize class fr.elsevier.tests.baseselenium @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:190) @ org.apache.maven.surefire.report.smartstacktraceparser.getclass(smartstacktraceparser.java:63) @ org.apache.maven.surefire.report.smartstacktraceparser.<init>(smartstacktraceparser.java:53) @ org.apache.maven.surefire.common.junit4.junit4stacktracewriter.smarttrimmedstacktrace(junit4stacktracewriter.java:72) [...] @ org.apache.maven.surefire.junit4.junit4provider.invoke(junit4provider.java:124)
searchtest extends baseselenium.
which means cannot find class in source folder. project structure this:
src/ fr.elsevier.tests/ disponibilite/ searchtest.java baseselenium.java pom.xml
why build generates these noclassdeffounderrors , how fix it?
try using -e or -x command line argument in local , hudson build. try compare classpath of java processes launched.
you can figure out part of maven lifecycle threw exception better stacktrace.
Comments
Post a Comment