3 Replies Latest reply on May 23, 2018 3:45 AM by Nicklas Karlsson

    Cube JAX-RS dependency

    Nicklas Karlsson Master

      I'm trying to setup a jenkins master that kicks off a SSH-communicating docker slave that runs arquillian cube for starting a postgresql-test-db and launching a WildFly through a remote connector.

      I've tried mapping the docker socket to the slave container and using a unix:///var/run/docker.sock for dockr serverUri in arquillian.xml but apparently dockerjava still insists on calling the Docker REST endpoint since I get a stacktrace of

       

       

      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

              at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:146)

              at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:89)

              at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:49)

              at org.jboss.arquillian.junit.AdaptorManager.initializeAdaptor(AdaptorManager.java:21)

              at org.jboss.arquillian.junit.AdaptorManagerWithNotifier.initializeAdaptor(AdaptorManagerWithNotifier.java:19)

              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:109)

              at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)

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

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

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

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

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

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

              at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

              at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

              at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)

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

      Caused by: java.lang.reflect.InvocationTargetException

              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:423)

              at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:144)

              ... 17 more

      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

              at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:103)

              at com.github.dockerjava.jaxrs.JerseyDockerCmdExecFactory.init(JerseyDockerCmdExecFactory.java:229)

              at com.github.dockerjava.core.DockerClientImpl.withDockerCmdExecFactory(DockerClientImpl.java:161)

              at com.github.dockerjava.core.DockerClientBuilder.build(DockerClientBuilder.java:47)

              at org.arquillian.cube.docker.impl.util.DefaultDocker.getDefaultDockerClient(DefaultDocker.java:13)

              at org.arquillian.cube.docker.impl.client.CubeDockerConfigurationResolver.resolveSystemDefaultSetup(CubeDockerConfigurationResolver.java:217)

              at org.arquillian.cube.docker.impl.client.CubeDockerConfigurationResolver.resolve(CubeDockerConfigurationResolver.java:70)

              at org.arquillian.cube.docker.impl.client.CubeDockerConfigurator.configure(CubeDockerConfigurator.java:82)

              at org.arquillian.cube.docker.impl.client.CubeDockerConfigurator.configure(CubeDockerConfigurator.java:63)

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

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

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

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

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

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

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

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

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

              at org.jboss.arquillian.core.impl.ManagerImpl.bindAndFire(ManagerImpl.java:232)

              at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:67)

              at org.arquillian.cube.impl.client.CubeConfigurator.configure(CubeConfigurator.java:23)

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

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

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

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

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

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

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

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

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

              at org.jboss.arquillian.core.impl.ManagerImpl.bindAndFire(ManagerImpl.java:232)

              at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:67)

              at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:72)

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

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

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

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

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

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

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

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

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

              at org.jboss.arquillian.core.impl.ManagerImpl.start(ManagerImpl.java:253)

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:61)

              ... 22 more

      Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

              at javax.ws.rs.client.FactoryFinder.getModuleClassLoader(FactoryFinder.java:258)

              at javax.ws.rs.client.FactoryFinder.find(FactoryFinder.java:203)

              at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:87)

              ... 65 more

      Caused by: java.lang.reflect.InvocationTargetException

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

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

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

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

              at javax.ws.rs.client.FactoryFinder.getModuleClassLoader(FactoryFinder.java:250)

              ... 67 more

      Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.resteasy.resteasy-jaxrs-api:main

              at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:240)

              ... 72 more

       

       

      What I'm not getting is that it appears to be the WildFly module loader that doesn't pick up some module but where does it get that module from? In WildFly 12 there is no such module(?) so providing that dependency through jboss-deployment-structure.xml is not going to work anyway, right?

      Am I using some wrong version of something(tm) and Cube is passing in something old into the dockerjava DockerClientBuilder?

        • 1. Re: Cube JAX-RS dependency
          Nicklas Karlsson Master

          Ping aslak, is ARQ still alive? ;-)

           

          The strange thing is that even if I have the serverURI defined as socket (and I can see it outputted when cube starts), dockerjava still insists on using the REST-integration. And the container has access to the socket, I've tested that by ssh:ing into the container and doing a curl against it. I've also modified the image to run a simple dockerjava test program and that works, too.

           

          I tried including the RESTeasy client jars into the test archive but it started crying about not being able to handle the json-response and adding jersey too didn't help for some reason so I did a fallback to mounting the socket...

          • 2. Re: Cube JAX-RS dependency
            Nicklas Karlsson Master

            Soooo, any theories why

             

            1. Cube/docker-java doesn't pick up the unix:///var/run/docker.sock in the slave image even if it exists and is runnable?
            2. Why it starts complaining about the jaxrs-api module?
            3. What to do about it?

             

            PS. How is docker-java even called? I tried exporting the ftest from cube/docker and I didn't see it merged into any jar but still it's there in the stacktrace.

             

            Strange.

            • 3. Re: Cube JAX-RS dependency
              Nicklas Karlsson Master

              Back to REST attempt. I tried the

               

              <systemPropertyVariables>

                   <!--  Force Jersey to be used when RestEasy is auto-discovered. Jersey is required by docker-java -->

                   <javax.ws.rs.ext.RuntimeDelegate>org.glassfish.jersey.internal.RuntimeDelegateImpl</javax.ws.rs.ext.RuntimeDelegate>

              </systemPropertyVariables>

               

              mentioned in

               

              Fix transitive deps with jaxrs issues · Issue #57 · arquillian/arquillian-cube · GitHub

               

              but I *still* get the resteasy module reference!