4 Replies Latest reply on Oct 3, 2011 10:13 AM by viniciuscarvalho

    Can't run tests

    viniciuscarvalho

      Hi, sorry for the overflow, but the inertia for start seems to be big.

       

      I gave up running weld-ee tests and tried to run embedded jboss 6.

       

      I'm using version 1.0.0-SNAPSHOT, but it seems that it uses shrinkwrap-alpha-11 and I needed alpha-12.

       

      I forced alpha-12 version but I can't run the tests

       

      From inside eclipse I get an error:

       

      Exception occurred executing command line.

      Cannot run program "C:\Program Files\Java\jdk1.6.0_21\bin\javaw.exe" (in directory "C:\Users\evincar\workspace\service-bus\service-bus-jgroups"): CreateProcess error=87, The parameter is incorrect

       

      Tried from command line and get a different error (maybe the cause for this)

       

       

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.294 sec <<< FAILURE!

      initializationError(com.acme.services.cluster.JGroupsExtensionTest)  Time elapsed: 0.005 sec  <<< ERROR!

      java.lang.NoClassDefFoundError: org/jboss/shrinkwrap/descriptor/api/Node

                at java.lang.Class.getDeclaredConstructors0(Native Method)

                at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)

                at java.lang.Class.getConstructor0(Class.java:2699)

                at java.lang.Class.getConstructor(Class.java:1657)

                at org.jboss.shrinkwrap.descriptor.api.DescriptorInstantiator.createFromImplModelType(DescriptorInstantiator.java:135)

                at org.jboss.shrinkwrap.descriptor.api.DescriptorInstantiator.createFromUserView(DescriptorInstantiator.java:104)

                at org.jboss.shrinkwrap.descriptor.api.Descriptors.create(Descriptors.java:58)

                at org.jboss.shrinkwrap.descriptor.api.Descriptors.create(Descriptors.java:45)

                at org.jboss.arquillian.impl.bootstrap.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:55)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.impl.core.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.impl.core.EventContextImpl.invokeObservers(EventContextImpl.java:98)

                at org.jboss.arquillian.impl.core.EventContextImpl.proceed(EventContextImpl.java:80)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:126)

                at org.jboss.arquillian.impl.core.ManagerImpl.fire(ManagerImpl.java:106)

                at org.jboss.arquillian.impl.core.ManagerImpl.<init>(ManagerImpl.java:91)

                at org.jboss.arquillian.impl.core.ManagerBuilder.create(ManagerBuilder.java:74)

                at org.jboss.arquillian.impl.DeployableTestBuilder.build(DeployableTestBuilder.java:97)

                at org.jboss.arquillian.impl.DeployableTestBuilder.build(DeployableTestBuilder.java:67)

                at org.jboss.arquillian.junit.Arquillian.<init>(Arquillian.java:82)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

                at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

                at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)

                at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)

                at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)

                at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)

                at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)

                at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)

                at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:33)

                at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)

                at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)

                at $Proxy0.invoke(Unknown Source)

                at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)

                at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)

                at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

      Caused by: java.lang.ClassNotFoundException: org.jboss.shrinkwrap.descriptor.api.Node

                at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

                at java.security.AccessController.doPrivileged(Native Method)

                at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                ... 45 more

       

       

      I've double checked the pom file and it does have the Node class that is being questioned.

       

      Anyone could help me setting up this environment?

       

      Regards

        • 1. Re: Can't run tests
          kpiwko

          Hi Vinicius,

           

          shrinkwrap alpha-11 and alpha-12 are not internally compatible. You shouldn't use Arquillian 1.0.0-SNAPSHOT at all, it is really old. You should use 1.0.0.CR5, if you insist on using latest development release, use 1.0.0.Final-SNAPSHOT. You'll get far newer Shrinkwrap API than alpha-12.

           

          Karel

          • 2. Re: Can't run tests
            viniciuscarvalho

            Well, I'm using arquillian-junit. There's no such version. Also, the container versions do not match the version on the arquillian project.

             

            It would be great if we have a table mapping versions. That's where all the confusion is coming from. I can't get a stable build on my environment cause I don't know what versions to use with arquilian-junit and the container.

             

            Could you give me a sample of this pom? Just the dependencies for the junit and container?

             

            Regards

            • 3. Re: Can't run tests
              kpiwko

              http://community.jboss.org/wiki/MigrationToArquillian100CR1

               

              You can check the example with bom file for instance here (you likely don't need Arquillian Drone):

               

              https://github.com/kpiwko/blog/blob/master/drone-selenium/pom.xml

              • 4. Re: Can't run tests
                viniciuscarvalho

                Karel, thanks again for the help. Can't express how much your help is being appreciated.

                 

                BTW Congrats to the whole team on Duke's award reward

                 

                I think I'm almost there now . Read the migration guide, had loads of wrong dependencies on my pom (artifacts and versions)

                 

                I have pretty much copied the drone-selenium pom, but instead of using jboss7 I'm trying jboss-6 since this is our current development environment.

                 

                When I run the tests (using maven, it fails when running using eclipse junit) I get an exception from jboss:

                 

                14:52:38,870 ERROR [STDERR] SLF4J: Found binding in [jar:file:/C:/Users/evincar/.m2/repository/org/jboss/slf4j/slf4j-jboss-logging/1.0.2.GA/slf4j-jboss-logging-1.0.2.GA.jar!/org/slf4j/impl/StaticLoggerBinder.class]

                 

                 

                14:52:38,870 ERROR [STDERR] SLF4J: Found binding in [jar:file:/C:/Users/evincar/.m2/repository/org/jboss/slf4j/slf4j-jboss-logmanager/1.0.0.CR4/slf4j-jboss-logmanager-1.0.0.CR4.jar!/org/slf4j/impl/StaticLoggerBinder.class]

                 

                 

                14:52:38,871 ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

                 

                Well, it seems that the jboss-deepchain has both LoggerBinder. here's my pom snippet for the jboss-as-6-embedded

                 

                 

                <profile>
                 <id>jbossas-embedded-6</id>
                 <dependencies>
                  <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-jbossas-embedded-6</artifactId>
                    <version>1.0.0.CR2</version>
                  </dependency>
                  <dependency>
                   <groupId>org.jboss.jbossas</groupId>
                   <artifactId>jboss-as-depchain</artifactId>
                   <version>6.0.0.Final</version>
                   <type>pom</type>
                   </dependency>
                  </dependencies>
                  <dependencyManagement>
                   <dependencies>
                     <dependency>
                       <groupId>org.jboss.jbossas</groupId>
                       <artifactId>jboss-as-depchain</artifactId>
                       <version>6.0.0.Final</version>
                       <type>pom</type>
                       <scope>import</scope>
                    </dependency>
                  </dependencies>
                 </dependencyManagement>
                
                 <build>
                  <plugins>
                    <plugin>
                      <artifactId>maven-surefire-plugin</artifactId>
                      <configuration>
                      <additionalClasspathElements>
                        <additionalClasspathElement>C:/java/jboss-6.0.0.Final/client/jbossws-native-client.jar</additionalClasspathElement>
                        <!-- Because jbossweb.sar contains shared web.xml, which must be 
                        visible from same CL as TomcatDeployer.class.getClassLoader -->
                       <additionalClasspathElement>C:/java/jboss-6.0.0.Final/server/default/deploy/jbossweb.sar</additionalClasspathElement>
                      </additionalClasspathElements>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
                     <trimStackTrace>false</trimStackTrace>
                     <printSummary>true</printSummary>
                     <forkMode>once</forkMode>
                     <!-- MaxPermSize Required to bump the space for relective data like 
                       classes, methods, etc. EMB-41. Endorsed required for things like WS support 
                      (EMB-61) -->
                      <argLine>-Xmx512m -XX:MaxPermSize=256m
                         -Djava.net.preferIPv4Stack=true
                         -Djava.util.logging.manager=org.jboss.logmanager.LogManager
                         -Djava.endorsed.dirs=C:/java/jboss-6.0.0.Final/lib/endorsed
                         -Djboss.home=C:/java/jboss-6.0.0.Final
                         -Djboss.boot.server.log.dir=C:/java/jboss-6.0.0.Final</argLine>
                      </configuration>
                   </plugin>
                  </plugins>
                 </build>
                </profile>
                
                

                 

                 

                Since the jars that are conflicting are provided by jboss-deepchain I don't know if I can exclude them or not.

                 

                Any other suggestions?

                 

                Regards