2 Replies Latest reply on Aug 15, 2011 1:49 AM by Ralf Battenfeld

    Running JBoss 6.1 managed - Failed to shutdown error

    Ralf Battenfeld Apprentice

      Hi Aslak

       

      I tried out the managed mode for running test cases against JBoss 6.1 Snapshot. The tests are executed successfully but Arquillian is not able to shutdown the server for some reasons. Do you have an idea what the issue is?

       

      I also noticed that the server is started with debug log level. Is it possible to configured this via arquillian.xml?

       

      The stacktrace for the first issue is:

       

      java.lang.RuntimeException: Could not run @AfterSuite

          at org.jboss.arquillian.junit.Arquillian$1.shutdown(Arquillian.java:119)

          at org.jboss.arquillian.junit.Arquillian$1.testRunFinished(Arquillian.java:96)

          at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:71)

          at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41)

          at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:68)

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

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

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

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

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

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

      Caused by: org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not stop server

          at org.jboss.arquillian.container.jbossas.managed_6.JBossASLocalContainer.stop(JBossASLocalContainer.java:142)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$6.perform(ContainerLifecycleController.java:163)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$6.perform(ContainerLifecycleController.java:153)

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

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.stopContainer(ContainerLifecycleController.java:152)

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

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

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

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

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

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

          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$3.perform(ContainerLifecycleController.java:98)

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$3.perform(ContainerLifecycleController.java:91)

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

          at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.stopContainers(ContainerLifecycleController.java:90)

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

          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.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

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

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

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

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.afterSuite(EventTestRunnerAdaptor.java:73)

          at org.jboss.arquillian.junit.Arquillian$1.shutdown(Arquillian.java:108)

          ... 10 more

      Caused by: org.jboss.jbossas.servermanager.ServerShutdownException: Failed to shutdown server.Process was destroyed.

          at org.jboss.jbossas.servermanager.ServerController.stopServer(ServerController.java:500)

          at org.jboss.jbossas.servermanager.ServerManager.stopServer(ServerManager.java:174)

          at org.jboss.arquillian.container.jbossas.managed_6.JBossASLocalContainer.stop(JBossASLocalContainer.java:138)

          ... 64 more

      Caused by: java.lang.ClassCastException: javax.naming.Reference cannot be cast to javax.management.MBeanServerConnection

          at org.jboss.jbossas.servermanager.Server.getServerConnection(Server.java:691)

          at org.jboss.jbossas.servermanager.Server.doShutdown(Server.java:758)

          at org.jboss.jbossas.servermanager.ServerController.stopServer(ServerController.java:446)

          ... 66 more

       

       

        As discussed I am running the tests using Arquillian 1.0.0.CR1/CR2. The dependenices are configured as following:

       

      <dependency>

          <groupId>org.jboss.arquillian.junit</groupId>

          <artifactId>arquillian-junit-core</artifactId>

          <version>1.0.0.CR2</version>

          <scope>test</scope>

      </dependency>

       

      <dependency>

          <groupId>org.jboss.arquillian.junit</groupId>

          <artifactId>arquillian-junit-container</artifactId>

          <version>1.0.0.CR2</version>

          <scope>test</scope>

      </dependency>

       

      <dependency>

          <groupId>org.jboss.arquillian.testenricher</groupId>

          <artifactId>arquillian-testenricher-ejb</artifactId>

          <version>1.0.0.CR2</version>

          <scope>test</scope>

      </dependency>

       

      The profile looks like this:

      <profile>

          <id>jbossas-managed-6</id>

          <dependencies>

              <dependency>

                  <groupId>org.jboss.arquillian.container</groupId>

                  <artifactId>arquillian-jbossas-managed-6</artifactId>

                  <version>1.0.0.CR1</version>

              </dependency>

              <dependency>

                  <groupId>org.jboss.jbossas</groupId>

                  <artifactId>jboss-server-manager</artifactId>

                  <version>1.0.4.Final</version>

              </dependency>

              <dependency>

       

                  <!-- this solved the security jacc problem-->

                  <groupId>org.jboss.spec</groupId>

                  <artifactId>jboss-javaee-6.0</artifactId>

                  <version>1.0.0.Final</version>

                  <type>pom</type>

                  <scope>provided</scope>

              </dependency>


              <dependency>

                  <groupId>org.jboss.jbossas</groupId>

                  <artifactId>jboss-as-profileservice-client</artifactId>

                  <version>6.0.0.Final</version>

                  <type>pom</type>

              </dependency>

          </dependencies>

          <build>

              <testResources>

                  <testResource>

                      <directory>src/test/resource</directory>

                  </testResource>

              </testResources>

          </build>

      </profile>

       

      Thanks a lot for any help

      Ralf