0 Replies Latest reply on Sep 22, 2017 2:53 AM by Michael Huber

    Could not create new instance of class org.jboss.arquillian.container.was.remote_8_5.WebSphereRemoteContainerConfiguration

    Michael Huber Newbie

      Hello,

       

      we recently started testing one of our applications with Arquillian. It is a Java EE application that runs on a Websphere 8.5 server. The problem comes up on both liberty and full profile servers.

       

      The application uses Java CDI and creates its database connection via annotiations like @PersistenceUnit amd @Resource. We are running our tests on a remote server - hence the usage of a Websphere remote container.

       

      Im not really sure what is wrong here. Is the WebSphereRemoteContainerConfiguration the configuration on our remote server or is it the config in our arquillian.xml? Do we actually need to set some sort of special config lines to get this to work on a remote server?

      Any hint would be really appreciated! We are new to Arquillian in combination with Websphere and just cant get it to work at the moment.

       

      When we run one of our tests we get the following error message:

       

      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.container.was.remote_8_5.WebSphereRemoteContainerConfiguration

      at org.jboss.arquillian.container.impl.SecurityActions.newInstance(SecurityActions.java:166)

      at org.jboss.arquillian.container.impl.ContainerImpl.createDeployableConfiguration(ContainerImpl.java:112)

      at org.jboss.arquillian.container.impl.ContainerImpl.setup(ContainerImpl.java:181)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$7.perform(ContainerLifecycleController.java:149)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$7.perform(ContainerLifecycleController.java:145)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.setupContainer(ContainerLifecycleController.java:144)

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

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

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

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

      at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

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

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

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

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

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

      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$1.perform(ContainerLifecycleController.java:62)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$1.perform(ContainerLifecycleController.java:55)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachContainer(ContainerLifecycleController.java:209)

      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.setupContainers(ContainerLifecycleController.java:54)

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

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

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

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

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

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

      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:85)

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

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

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

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

      at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)

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

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

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

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

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

      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:75)

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

      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

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

      at org.jboss.arquillian.container.impl.SecurityActions.newInstance(SecurityActions.java:162)

      ... 62 more

      Caused by: java.lang.NumberFormatException: null

      at java.lang.Integer.parseInt(Integer.java:542)

      at java.lang.Integer.parseInt(Integer.java:615)

      at org.jboss.arquillian.container.was.remote_8_5.WebSphereRemoteContainerConfiguration.<init>(WebSphereRemoteContainerConfiguration.java:32)

      ... 67 more

       

      Arquillian.xml:

      <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
              http://jboss.org/schema/arquillian
              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
      
      
          <container qualifier="websphere-jenkins" default="true">
          <protocol type="Servlet 3.0">
               <property name="executionType">REMOTE</property>
            </protocol>
              <configuration>
                  <property name="archiveUploadEnabled">false</property>
                  <property name="remoteServerSoapPort">8898</property>            
                   <property name="remoteServerAddress">localhost</property>            
                  <property name="securityEnabled">false</property>
              </configuration>
          </container>
      </arquillian>
      

       

       

      With @Deployment annotated method - located in the test itself right now:

       

      @Deployment

        public static Archive<?> createDeployment() {

          System.out.println("DEPLOYMENT TestJobTicketService ");

       

       

          File[] files = Maven.resolver().loadPomFromFile("pom.xml", "profile")

              .importRuntimeAndTestDependencies()

              // .importTestDependencies()

              .resolve().withTransitivity().asFile();

       

       

          JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "application.jar")

              .addPackages(true, "specialprofile")

              // .addClass(DatabaseService.class).addClass(IOService.class).addClass(LogService.class)

              .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")

              .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

       

       

          System.out.println("====================================");

          // System.out.println(jar.toString(true));

          System.out.println("====================================");

       

       

          WebArchive app= ShrinkWrap.create(WebArchive.class, "app.war").addAsLibraries(files)

              .addAsLibraries(jar).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

       

       

          System.out.println("====================================");

          System.out.println(app.toString(true));

          System.out.println("====================================");

       

       

          return app;

        }