For that, you need the pax-url-aether dependency.

Regards
JB

On 12/11/2014 05:14 PM, Charles Moulliard wrote:
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]
<mailto:[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]>
        <mailto:[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]>>
                 <mailto:[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]>>>
                          <mailto:[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]>>>
                               <mailto:[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]>>>
                          <mailto:[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]>>>
                                       <mailto:[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]>>__> <mailto:[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>>


        <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]>>>
                          <mailto:[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]>>>
                          <mailto:[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]>>
                 <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>


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

Reply via email to