1 Reply Latest reply on Jul 18, 2011 12:08 PM by Aslak Knutsen

    tomcat-embedded failed to start container

    Juraj Húska Master

      Hi,

      I am trying to configure tomcat-embedded in Arquillian. I have these problems:

       

      When I am using 1.0.0-SNAPSHOT version of arquillian-tomcat-embedded-6, I have this exception:

       

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

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

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

      at org.jboss.arquillian.testng.Arquillian.arquillianBeforeSuite(Arquillian.java:54)

      at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:70)

      at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:149)

      at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:95)

      at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:114)

      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)

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

      ... 30 more

      Caused by: org.jboss.arquillian.container.impl.ContainerCreationException: Could not create Container jboss

      at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:80)

      at org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:68)

      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.ManagerImpl.bindAndFire(ManagerImpl.java:235)

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

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

      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.ManagerImpl.start(ManagerImpl.java:260)

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

      ... 35 more

      Caused by: java.lang.IllegalArgumentException: DeployableContainer must be specified

      at org.jboss.arquillian.core.spi.Validate.notNull(Validate.java:44)

      at org.jboss.arquillian.container.impl.ContainerImpl.<init>(ContainerImpl.java:43)

      at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:72)

      ... 59 more

      ... Removed 32 stack frames

       

      My full configuration of tomcat-embedded profile looks like:

       

       

      {code:xml}

      <profile>

                  <id>tomcat-embedded</id>

                  <dependencies>

                      <dependency>

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

                          <artifactId>arquillian-tomcat-embedded-6</artifactId>

                          <version>${arquillian.version}</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.apache.tomcat</groupId>

                          <artifactId>catalina</artifactId>

                          <version>6.0.29</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.apache.tomcat</groupId>

                          <artifactId>coyote</artifactId>

                          <version>6.0.29</version>

                          <scope>provided</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.apache.tomcat</groupId>

                          <artifactId>jasper</artifactId>

                          <version>6.0.29</version>

                          <scope>provided</scope>

                      </dependency>

                      <!-- Weld servlet, EL and JSP required for testing CDI injections -->

                      <dependency>

                          <groupId>org.jboss.weld.servlet</groupId>

                          <artifactId>weld-servlet</artifactId>

                          <version>1.1.1.Final</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.glassfish.web</groupId>

                          <artifactId>el-impl</artifactId>

                          <version>2.2</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>javax.servlet.jsp</groupId>

                          <artifactId>jsp-api</artifactId>

                          <version>2.2</version>

                          <scope>test</scope>

                      </dependency>

                  </dependencies>

              </profile>

      {code}

       

      and arquillian.xml:

       

      {code:xml}

      ...

      <container qualifier="tomcat" default="true">

              <configuration>

                  <property name="unpackArchive">true</property>

                  <property name="bindHttpPort">8080</property>

              </configuration>

      </container>

      ...

      {code}

       

      When I am using 1.0.0.CR1 version of arquillian-tomcat-embedded-6, I have these problems:

       

      1. it seems like it is trying to start tomcat twice, since there is this in log:

       

      Jul 18, 2011 4:07:26 PM org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator getActivatedConfiguration

      INFO: Could not read active container configuration: null

      Jul 18, 2011 4:07:26 PM org.apache.coyote.http11.Http11Protocol init

      INFO: Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080

      Jul 18, 2011 4:07:26 PM org.apache.catalina.startup.Embedded start

      INFO: Starting tomcat server

      Jul 18, 2011 4:07:26 PM org.apache.catalina.core.StandardEngine start

      INFO: Starting Servlet Engine: Apache Tomcat/6.0.29

      Jul 18, 2011 4:07:26 PM org.apache.catalina.connector.Connector initialize

      INFO: The connector has already been initialized

      Jul 18, 2011 4:07:26 PM org.apache.coyote.http11.Http11Protocol start

      INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

      Jul 18, 2011 4:07:26 PM org.apache.coyote.http11.Http11Protocol destroy

      INFO: Stopping Coyote HTTP/1.1 on http-127.0.0.1-8080

      Jul 18, 2011 4:07:26 PM org.apache.coyote.http11.Http11Protocol init

      INFO: Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080

      Jul 18, 2011 4:07:26 PM org.apache.catalina.startup.Embedded start

      INFO: Starting tomcat server

      Jul 18, 2011 4:07:26 PM org.apache.catalina.core.StandardEngine start

      INFO: Starting Servlet Engine: Apache Tomcat/6.0.29

      Jul 18, 2011 4:07:26 PM org.apache.catalina.connector.Connector initialize

      INFO: The connector has already been initialized

      Jul 18, 2011 4:07:26 PM org.apache.coyote.http11.Http11Protocol start

      INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

      Jul 18, 2011 4:07:27 PM org.apache.catalina.connector.Connector stop

      SEVERE: Coyote connector has not been started

      Jul 18, 2011 4:07:27 PM org.apache.coyote.http11.Http11Protocol destroy

      INFO: Stopping Coyote HTTP/1.1 on http-127.0.0.1-8080

      Jul 18, 2011 4:07:27 PM org.apache.catalina.core.StandardPipeline unregisterValve

       

       

      2. then an exception is thrown with following stacktrace:

       

      INFO: Can't unregister valve org.apache.catalina.core.StandardEngineValve[arquillian-tomcat-embedded-6]

      javax.management.InstanceNotFoundException: arquillian-tomcat-embedded-6:type=Valve,name=StandardEngineValve

              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094)

              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:415)

              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403)

              at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506)

              at org.apache.catalina.core.StandardPipeline.unregisterValve(StandardPipeline.java:322)

              at org.apache.catalina.core.StandardPipeline.stop(StandardPipeline.java:275)

              at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1091)

              at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:450)

              at org.apache.catalina.startup.Embedded.stop(Embedded.java:867)

              at org.jboss.arquillian.container.tomcat.embedded_6.TomcatContainer.stopTomcatEmbedded(TomcatContainer.java:333)

              at org.jboss.arquillian.container.tomcat.embedded_6.TomcatContainer.stop(TomcatContainer.java:151)

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

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

              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.GeneratedMethodAccessor17.invoke(Unknown Source)

              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.testng.Arquillian.arquillianAfterSuite(Arquillian.java:67)

              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.testng.Arquillian.arquillianAfterSuite(Arquillian.java:67)

              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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74)

              at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)

              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)

              at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)

              at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)

              at org.testng.SuiteRunner.run(SuiteRunner.java:223)

              at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

              at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

              at org.testng.TestNG.runSuitesSequentially(TestNG.java:995)

              at org.testng.TestNG.runSuitesLocally(TestNG.java:920)

              at org.testng.TestNG.run(TestNG.java:856)

              at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:70)

              at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:149)

              at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:95)

              at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:114)

              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)

       

      Thanks for any ideas.