Hi JB, I have been able to resolve the issue. This maven artifact "pax-exam-junit4" used was the version 3.5 and not 4.3.0. Reason why the field (setAnnotationHandler) was not retrieved.
But now I get this other error : java.lang.NoClassDefFoundError: org/ops4j/pax/url/maven/commons/MavenSettings at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493) at java.lang.Class.getConstructor0(Class.java:2803) at java.lang.Class.newInstance(Class.java:345) at java.net.URL.getURLStreamHandler(URL.java:1199) at java.net.URL.<init>(URL.java:590) at java.net.URL.<init>(URL.java:482) at java.net.URL.<init>(URL.java:431) at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:148) at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79) Regards, On Thu, Dec 11, 2014 at 11:05 AM, Jean-Baptiste Onofré <[email protected]> wrote: > Hi Charles, > > sorry, I was on something else. I will take a look this afternoon. > > I keep you posted. > > Regards > JB > > On 12/11/2014 11:03 AM, Charles Moulliard wrote: > >> Any idea ? >> >> On Wed, Dec 10, 2014 at 5:10 PM, Jean-Baptiste Onofré <[email protected] >> <mailto:[email protected]>> wrote: >> >> As replied on the ops4j mailing list, I think something is wrong in >> the import in the test classes. Check there. >> >> Again, we use Pax Exam 4.3.0 in Karaf 2.4.x itests, so it works for >> sure ;) >> >> Regards >> JB >> >> On 12/10/2014 05:03 PM, Charles Moulliard wrote: >> >> Problem still there using the dependencies you mentioned >> >> <dependency> >> <groupId>org.ops4j.pax.exam</__groupId> >> <artifactId>pax-exam-__container-karaf</artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.ops4j.pax.exam</__groupId> >> <artifactId>pax-exam-junit4</__artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.apache.geronimo.__specs</groupId> >> <artifactId>geronimo-atinject_ >> __1.0_spec</artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.ops4j.pax.url</__groupId> >> <artifactId>pax-url-aether</__artifactId> >> <scope>test</scope> >> </dependency> >> >> On Wed, Dec 10, 2014 at 4:45 PM, Jean-Baptiste Onofré >> <[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>>> wrote: >> >> You should have: >> >> <dependency> >> <groupId>org.ops4j.pax.exam</____groupId> >> >> <artifactId>pax-exam-____container-karaf</artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.ops4j.pax.exam</____groupId> >> <artifactId>pax-exam-junit4</____artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.apache.geronimo._ >> ___specs</groupId> >> >> <artifactId>geronimo-atinject_____1.0_spec</artifactId> >> <version>1.0</version> >> <scope>test</scope> >> </dependency> >> >> <dependency> >> <groupId>org.ops4j.pax.url</____groupId> >> <artifactId>pax-url-aether</____artifactId> >> <scope>test</scope> >> </dependency> >> >> >> And the karaf dependency: pax-exam-spi and pax-exam-inject >> should >> not be there as they are transitive dependencies. >> >> FYI, it's what we have in karaf-2.x itests themselves (with >> pax-exam >> 4.3.0). >> >> Regards >> JB >> >> >> On 12/10/2014 04:00 PM, Charles Moulliard wrote: >> >> Here are the deps that I'm using for pax-exam without >> success --> >> >> <dependency> >> <groupId>org.ops4j.pax.exam</____groupId> >> <artifactId>pax-exam-junit4</_ >> ___artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.ops4j.pax.exam</____groupId> >> <artifactId>pax-exam-spi</____artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.ops4j.pax.exam</____groupId> >> >> <artifactId>pax-exam-____container-karaf</artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> >> <groupId>org.apache.geronimo.____specs</groupId> >> >> <artifactId>geronimo-atinject_____1.0_spec</artifactId> >> <scope>test</scope> >> </dependency> >> <dependency> >> <groupId>org.ops4j.pax.exam</____groupId> >> <artifactId>pax-exam-inject</_ >> ___artifactId> >> <scope>test</scope> >> </dependency> >> >> On Wed, Dec 10, 2014 at 3:49 PM, Charles Moulliard >> <[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>>>> wrote: >> >> Error is the same even if I add >> geronimo-atinject_1.0_spec-1.____0.jar >> >> On Wed, Dec 10, 2014 at 3:44 PM, Charles Moulliard >> <[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>>>> wrote: >> >> No. Just javax.inject >> >> >> (~/.m2/repository/javax/____inject/javax.inject/1/javax.__ >> __inject-1.jar) >> Do I have to add it ? >> >> On Wed, Dec 10, 2014 at 2:16 PM, Jean-Baptiste >> Onofré >> <[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>>>> wrote: >> >> Did you add geronimo ati inject dependency ? >> >> Regards >> JB >> >> >> Sent from my Samsung Galaxy smartphone. >> >> >> -------- Original message -------- >> From: Charles Moulliard <[email protected] >> <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] >> <mailto:[email protected]> <mailto:[email protected] >> <mailto:[email protected]>>>> >> Date:10/12/2014 13:57 (GMT+01:00) >> To: [email protected] >> <mailto:[email protected]> >> <mailto:[email protected] >> <mailto:[email protected]>> <mailto:[email protected] >> <mailto:[email protected]> >> <mailto:[email protected] >> <mailto:[email protected]>>__> >> Cc: >> Subject: Re: Issue with pax exam - missing >> jar maybe >> >> I have upgraded to paxexam 4.3 & Karaf >> 2.4.0 but >> now I get >> another error even if the dependency >> pax-exam-spi >> is in the >> classpath : >> https://gist.github.com/____cmoulliard/____2c673628f35156d71714 >> <https://gist.github.com/__cmoulliard/__2c673628f35156d71714> >> >> <https://gist.github.com/__cmoulliard/__2c673628f35156d71714 >> <https://gist.github.com/cmoulliard/2c673628f35156d71714>> >> >> Tests run: 1, Failures: 0, Errors: 1, >> Skipped: 0, Time >> elapsed: 0.14 sec <<< FAILURE! - in >> >> >> org.drools.karaf.itest.____DroolsOnBodyCamelKarafIntegrat >> ____ionTest >> >> >> initializationError(org.____drools.karaf.itest.____ >> DroolsOnBodyCamelKarafIntegrat____ionTest) >> Time elapsed: 0.007 sec <<< ERROR! >> java.lang.NoSuchMethodError: >> >> >> org.ops4j.pax.exam.spi.____reactors.ReactorManager.____ >> setAnnotationHandler(Lorg/____ops4j/pax/exam/spi/reactors/__ >> __AnnotationHandler;)V >> at >> >> >> org.ops4j.pax.exam.junit.impl.____ProbeRunner.<init>(____ >> ProbeRunner.java:79) >> at >> >> >> org.ops4j.pax.exam.junit.____PaxExam.createDelegate(____ >> PaxExam.java:82) >> at >> >> org.ops4j.pax.exam.junit.____PaxExam.<init>(PaxExam.java:____73) >> at >> >> >> sun.reflect.____NativeConstructorAccessorImpl. >> ____newInstance0(Native >> Method) >> at >> >> >> sun.reflect.____NativeConstructorAccessorImpl. >> ____newInstance(____NativeConstructorAccessorImpl.____java:57) >> at >> >> >> sun.reflect.____DelegatingConstructorAccessorI >> ____mpl.newInstance(____DelegatingConstructorAccessorI____mpl.java:45) >> at >> >> >> java.lang.reflect.Constructor.____newInstance(Constructor.__ >> java:__526) >> at >> >> >> org.junit.internal.builders.____AnnotatedBuilder.buildRunner(____ >> AnnotatedBuilder.java:29) >> at >> >> >> org.junit.internal.builders.____AnnotatedBuilder.____ >> runnerForClass(____AnnotatedBuilder.java:21) >> at >> >> >> org.junit.runners.model.____RunnerBuilder.____ >> safeRunnerForClass(____RunnerBuilder.java:59) >> at >> >> >> org.junit.internal.builders.____AllDefaultPossibilitiesBuilder >> ____.runnerForClass(____AllDefaultPossibilitiesBuilder____.java:26) >> at >> >> >> org.junit.runners.model.____RunnerBuilder.____ >> safeRunnerForClass(____RunnerBuilder.java:59) >> at >> >> >> org.junit.internal.requests.____ClassRequest.getRunner(____ >> ClassRequest.java:26) >> at >> >> >> org.apache.maven.surefire.____junit4.JUnit4Provider.execute( >> ____JUnit4Provider.java:262) >> at >> >> >> org.apache.maven.surefire.____junit4.JUnit4Provider.____ >> executeTestSet(JUnit4Provider.____java:153) >> at >> >> >> org.apache.maven.surefire.____junit4.JUnit4Provider.invoke(_ >> ___JUnit4Provider.java:124) >> at >> >> >> org.apache.maven.surefire.____booter.ForkedBooter.____ >> invokeProviderInSameClassLoade____r(ForkedBooter.java:200) >> >> On Wed, Dec 10, 2014 at 1:13 PM, >> Jean-Baptiste Onofré >> <[email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] <mailto:[email protected]> >> >> <mailto:[email protected] <mailto:[email protected]>>>> wrote: >> >> Hi, >> >> Which Pax Exam version do you use and >> Karaf >> version ? >> >> With 4.3.0, it should work out of the >> box with >> Karaf 3.x. >> >> With previous version, you may need to >> add the >> pax-url-aether dependency. >> >> Regards >> JB >> >> >> On 12/10/2014 12:56 PM, Charles >> Moulliard wrote: >> >> Hi, >> >> Whenever I run an integration test >> using >> pax exam >> karaf container, I get >> this classloading error message >> >> Tests run: 1, Failures: 0, Errors: >> 1, >> Skipped: 0, >> Time elapsed: 0.004 >> sec <<< FAILURE! - in >> >> >> org.drools.karaf.itest.______DroolsOnCommandCamelKarafInteg >> ______rationTest >> >> >> testRuleOnCommand(org.drools.______karaf.itest.______ >> DroolsOnCommandCamelKarafInteg______rationTest) >> Time elapsed: 0.003 sec <<< >> ERROR! >> java.lang.NoSuchMethodError: >> >> >> org.ops4j.pax.url.mvn.______internal.Connection.<init>(___ >> ___Ljava/net/URL;Lorg/ops4j/pax/______url/maven/commons/__ >> ____MavenConfiguration;)V >> at >> >> >> org.ops4j.pax.url.mvn.Handler.______openConnection(Handler._ >> _java:____48) >> at >> java.net.URL.openConnection(______URL.java:971) >> at >> java.net.URL.openStream(URL.______java:1037) >> at >> >> >> org.ops4j.pax.exam.karaf.______container.internal.______ >> ArchiveExtractor.______extractTarGzDistribution(_____ >> _ArchiveExtractor.java:81) >> at >> >> >> org.ops4j.pax.exam.karaf.______container.internal.______ >> ArchiveExtractor.extract(______ArchiveExtractor.java:70) >> at >> >> >> org.ops4j.pax.exam.karaf.______container.internal.______ >> KarafTestContainer.start(______KarafTestContainer.java:150) >> at >> >> >> org.ops4j.pax.exam.spi.______reactors.______ >> AllConfinedStagedReactor.______invoke(______ >> AllConfinedStagedReactor.java:______79) >> at >> >> >> org.ops4j.pax.exam.junit.impl.______ProbeRunner$2.evaluate(_ >> _____ProbeRunner.java:278) >> at >> >> >> org.junit.runners.______ParentRunner.runLeaf(______ >> ParentRunner.java:271) >> at >> >> >> org.junit.runners.______BlockJUnit4ClassRunner.______ >> runChild(______BlockJUnit4ClassRunner.java:______70) >> at >> >> >> org.junit.runners.______BlockJUnit4ClassRunner.______ >> runChild(______BlockJUnit4ClassRunner.java:______50) >> at >> >> >> org.junit.runners.______ParentRunner$3.run(______ >> ParentRunner.java:238) >> at >> >> >> org.junit.runners.______ParentRunner$1.schedule(______ >> ParentRunner.java:63) >> at >> >> >> org.junit.runners.______ParentRunner.runChildren(_____ >> _ParentRunner.java:236) >> at >> >> >> org.junit.runners.______ParentRunner.access$000(______ >> ParentRunner.java:53) >> at >> >> >> org.junit.runners.______ParentRunner$2.evaluate(______ >> ParentRunner.java:229) >> at >> >> >> org.junit.runners.______ParentRunner.run(ParentRunner. >> ______java:309) >> at >> >> >> org.ops4j.pax.exam.junit.impl.______ProbeRunner.run(__ >> ProbeRunner.____java:112) >> at >> >> org.ops4j.pax.exam.junit._____ >> _PaxExam.run(PaxExam.java:93) >> at >> >> >> org.apache.maven.surefire.______junit4.JUnit4Provider. >> execute(______JUnit4Provider.java:264) >> at >> >> >> org.apache.maven.surefire.______junit4.JUnit4Provider.______ >> executeTestSet(JUnit4Provider.______java:153) >> at >> >> >> org.apache.maven.surefire.______junit4.JUnit4Provider. >> invoke(______JUnit4Provider.java:124) >> at >> >> >> org.apache.maven.surefire.______booter.ForkedBooter.______ >> invokeProviderInSameClassLoade______r(ForkedBooter.java:200) >> at >> >> >> org.apache.maven.surefire.______booter.ForkedBooter.______ >> runSuitesInProcess(______ForkedBooter.java:153) >> at >> >> >> org.apache.maven.surefire.______booter.ForkedBooter.main(___ >> ___ForkedBooter.java:103) >> >> Do I miss a dependency ? >> >> <dependency> >> >> <groupId>org.ops4j.pax.exam</______groupId> >> >> <artifactId>pax-exam-junit4</______artifactId> >> <scope>test</scope> >> </dependency> >> >> <dependency> >> >> <groupId>org.ops4j.pax.exam</______groupId> >> >> >> <artifactId>pax-exam-______container-karaf</artifactId> >> >> <scope>test</scope> >> </dependency> >> >> Regards, >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : >> http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> >> -- >> Jean-Baptiste Onofré >> [email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> <mailto:[email protected] >> <mailto:[email protected]> <mailto:[email protected] >> <mailto:[email protected]>>> >> >> >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : >> http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : >> http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : >> http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : >> http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> >> -- >> Jean-Baptiste Onofré >> [email protected] <mailto:[email protected]> >> <mailto:[email protected] <mailto:[email protected]>> >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> >> -- >> Jean-Baptiste Onofré >> [email protected] <mailto:[email protected]> >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Architect @RedHat >> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io >> <http://cmoulliard.github.io> >> >> > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
