wisdom-framework / wisdom

A modular and dynamic web framework
http://wisdom-framework.org
Apache License 2.0
88 stars 42 forks source link

Conflict maven dependency Vertx and Wisdom during testing mode. #519

Closed nicko466 closed 8 years ago

nicko466 commented 9 years ago

Hi,

I've currently created a project with a websocket client in java by using maven dependency vertx-platform and vertx-core version 2.1.5.

When i'm launching my application everyting works fine. But when i'm running the tests (which extends WisdomBlackBoxTest and WisdomTest), it fails with this error : java.lang.NoClassDefFoundError: Could not initialize class org.wisdom.maven.osgi.Classpath at org.wisdom.maven.osgi.BundlePackager.bundle(BundlePackager.java:84) at org.wisdom.test.internals.ChameleonExecutor.deployApplication(ChameleonExecutor.java:218) at org.wisdom.test.WisdomBlackBoxRunner.(WisdomBlackBoxRunner.java:70) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) 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:33) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

When I remove my maven dependencies on Vertx the test pass. It seems there is a conflic between Vertx and Wisdom during the test. Any idea how I can make it works?

Thanks for your help.

cescoffier commented 9 years ago

Hi,

The vert.x dependencies need to be in the scope “provided”, because they are embedded in the vertx engine.

Clement

On 12 juin 2015 at 17:20:34, nicko466 (notifications@github.com) wrote:

Hi,

I've currently created a project with a websocket client in java by using maven dependecy vertx :

io.vertx vertx-platform 2.1.5

io.vertx vertx-core 2.1.5

When i'm launching my application everyting works fine. But when i'm running the tests (which extends WisdomBlackBoxTest and WisdomTest), it fails with this error : java.lang.NoClassDefFoundError: Could not initialize class org.wisdom.maven.osgi.Classpath at org.wisdom.maven.osgi.BundlePackager.bundle(BundlePackager.java:84) at org.wisdom.test.internals.ChameleonExecutor.deployApplication(ChameleonExecutor.java:218) at org.wisdom.test.WisdomBlackBoxRunner.(WisdomBlackBoxRunner.java:70) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) 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:33) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

When I remove my maven dependencies on Vertx the test pass. It seems there is a conflic between Vertx and Wisdom during the test. Any idea how I can make it works?

Thanks for your help.

— Reply to this email directly or view it on GitHub.

nicko466 commented 9 years ago

Thanks for your fast help. We already try it but it doesn't work. The same error appears.

cescoffier commented 9 years ago

Well, seems the the error is not a runtime error at all, but something happening in the Maven tooling.  Could you provide a reproducer ?

On 12 juin 2015 at 17:20:34, nicko466 (notifications@github.com) wrote:

Hi,

I've currently created a project with a websocket client in java by using maven dependecy vertx :

io.vertx vertx-platform 2.1.5

io.vertx vertx-core 2.1.5

When i'm launching my application everyting works fine. But when i'm running the tests (which extends WisdomBlackBoxTest and WisdomTest), it fails with this error : java.lang.NoClassDefFoundError: Could not initialize class org.wisdom.maven.osgi.Classpath at org.wisdom.maven.osgi.BundlePackager.bundle(BundlePackager.java:84) at org.wisdom.test.internals.ChameleonExecutor.deployApplication(ChameleonExecutor.java:218) at org.wisdom.test.WisdomBlackBoxRunner.(WisdomBlackBoxRunner.java:70) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) 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:33) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

When I remove my maven dependencies on Vertx the test pass. It seems there is a conflic between Vertx and Wisdom during the test. Any idea how I can make it works?

Thanks for your help.

— Reply to this email directly or view it on GitHub.

nicko466 commented 9 years ago

Just for information my wisdom framework plugin is define like this :

<plugin>
            <groupId>org.wisdom-framework</groupId>
             <artifactId>wisdom-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <skipGoogleClosure>true</skipGoogleClosure>
                    <libraries>
                        <includes>
                            <include>:geronimo-jta_1.1_spec</include>
                        </includes>
                        <resolveTransitive>true</resolveTransitive>
                        <excludeFromApplication>true</excludeFromApplication>
                    </libraries>
                </configuration>
            </plugin>
cescoffier commented 8 years ago

As we switched to vert.x 3.1 (and soon 3.2), I close this issue.