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]>> 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]>>> 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]>>> 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]>>> 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]>>>
                     Date:10/12/2014 13:57 (GMT+01:00)
                     To: [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>

                     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]>>> 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]>>

        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]>
    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

Reply via email to