2 Replies Latest reply on Mar 8, 2014 10:28 AM by xybrek

    Cannot run Arquillian Tests for Google App Engine

    xybrek Newbie

      I'm trying to run Arquillian test for GAE container, however I am getting this error:

       

          com.google.apphosting.utils.config.AppEngineConfigException: Could not locate /tmp/servlet-test.war/WEB-INF/appengine-web.xml

          at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:140)com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:140)

       

      All my other non-Arquillian tests works fine, not sure why this happens, should I put `appengine-web.xml` into the test folder? Or having it in the `/src/main/webapp/WEB-INF` should be fine?

       

      Also in the Maven surefire report I can see this:

       

          com.mycompany.AnnotatedEchoServletTestCase  Time elapsed: 1.131 sec  <<< ERROR!

          java.lang.NoSuchMethodError: com.google.appengine.tools.development.DevAppServer.start()Ljava/util/concurrent/CountDownLatch;

          at org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer.doDeploy(AppEngineEmbeddedContainer.java:74)

       

      I'm just running this [AnnotatedEchoServletTestCase][1] with GAE container.

       

        [1]: https://github.com/arquillian/arquillian-showcase/blob/master/servlet/src/test/java/com/acme/servlet/AnnotatedEchoServletTestCase.java

       

      My app have this dependency in the app:

       

        <!-- Added for GAE Arquillian Testing -->

        <dependency>

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

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

        <version>1.0.0.Final</version>

        <type>pom</type>

        <scope>provided</scope>

        <exclusions>

                   <exclusion>

               <groupId>org.jboss.resteasy</groupId>

               <artifactId>jaxrs-api</artifactId>

                   </exclusion>

                </exclusions>

        </dependency>

        <dependency>

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

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

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

                  <scope>test</scope>

        </dependency>

        <dependency>

        <groupId>org.slf4j</groupId>

        <artifactId>slf4j-simple</artifactId>

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

        <scope>test</scope>

        </dependency>

              <dependency>

                  <groupId>org.jboss.shrinkwrap.descriptors</groupId>

                  <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>

              </dependency>

             <dependency>

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

                 <artifactId>arquillian-gae-embedded</artifactId>

                 <version>1.0.0.Beta7</version>

             </dependency>

             <!-- End GAE Arquillian Testing -->

       

      What could be missing in my configuration?

        • 1. Re: Cannot run Arquillian Tests for Google App Engine
          Karel Piwko Master

          Hi Xybrek,

           

          according to NoSuchMethod exception, you seem to be using GAE 1.5, or definitely GAE pre 1.8 [1]. Please update you GAE version to 1.8 or later. As you can see from Arquillian GAE container, it is build against 1.8.3 .

          I expect that would fix the issue.

           

          Regards,

           

          Karel

           

          [1] http://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/google/appengine/tools/development/DevApp…

          • 2. Re: Cannot run Arquillian Tests for Google App Engine
            xybrek Newbie

            I tried to run with:

             

             

                $ mvn -Dtest=AnnotatedEchoServletTestCase test -Dappengine.sdk.root=/home/xybrek/buildtools/appengine-java-sdk-1.8.4

             

             

            This is the log:

             

             

            -------------------------------------------------------

            T E S T S

            -------------------------------------------------------

             

             

                Running com.myapp.AnnotatedEchoServletTestCase

                Mar 07, 2014 6:15:20 PM org.jboss.arquillian.container.appengine.embedded.AppEngineSetup prepare

                INFO: servlet-test.war:

                /WEB-INF/

                /WEB-INF/lib/

                /WEB-INF/lib/appengine-api-1.0-sdk-1.8.4.jar

                /WEB-INF/classes/

                /WEB-INF/classes/com/

                /WEB-INF/classes/com/myapp/

                /WEB-INF/classes/com/myapp/EchoServlet.class

                /WEB-INF/classes/org/

                /WEB-INF/classes/org/jboss/

                /WEB-INF/classes/org/jboss/arquillian/

                /WEB-INF/classes/org/jboss/arquillian/container/

                /WEB-INF/classes/org/jboss/arquillian/container/appengine/

                /WEB-INF/classes/org/jboss/arquillian/container/appengine/embedded/

                /WEB-INF/classes/org/jboss/arquillian/container/appengine/embedded/hack/

                /WEB-INF/classes/org/jboss/arquillian/container/appengine/embedded/hack/AppEngineHack.class

                /WEB-INF/classes/org/jboss/arquillian/container/appengine/embedded/hack/AppEngineHack$1.class

                /WEB-INF/classes/org/jboss/arquillian/container/appengine/embedded/hack/AppEngineHack$2.class

                Mar 07, 2014 6:15:20 PM org.jboss.arquillian.container.common.AppEngineCommonContainer$1 run

                INFO: Get temp root: /tmp

                Mar 07, 2014 6:15:21 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml

                SEVERE: Received exception processing /tmp/servlet-test.war/WEB-INF/appengine-web.xml

                com.google.apphosting.utils.config.AppEngineConfigException: Could not locate /tmp/servlet-test.war/WEB-INF/appengine-web.xml

                  at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:140)

                  at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:75)

                  at com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:166)

                  at com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:399)

                  at com.google.appengine.tools.development.ApplicationConfigurationManager.<init>(ApplicationConfigurationManager.java:146)

                  at com.google.appengine.tools.development.ApplicationConfigurationManager.newWarConfigurationManager(ApplicationConfigurationManager.java:88)

                  at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:137)

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

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

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

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

                  at org.jboss.arquillian.container.appengine.embedded.hack.DevAppServerFactoryHack.createDevAppServer(DevAppServerFactoryHack.java:36)

                  at org.jboss.arquillian.container.appengine.embedded.hack.DevAppServerFactoryHack.createDevAppServer(DevAppServerFactoryHack.java:25)

                  at org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer$1.run(AppEngineEmbeddedContainer.java:68)

                  at org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer$1.run(AppEngineEmbeddedContainer.java:66)

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

                  at org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer.doDeploy(AppEngineEmbeddedContainer.java:66)

                  at org.jboss.arquillian.container.common.AppEngineCommonContainer.deploy(AppEngineCommonContainer.java:94)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

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

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

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

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

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

                  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.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

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

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

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

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

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

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

                  at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

                  at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  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.createClassContext(TestContextHandler.java:75)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

                  at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

                  at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                  at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                  at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

                  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

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

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

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

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

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

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

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

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

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

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

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

                  at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)

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

                Caused by: java.io.FileNotFoundException: /tmp/servlet-test.war/WEB-INF/appengine-web.xml (No such file or directory)

                  at java.io.FileInputStream.open(Native Method)

                  at java.io.FileInputStream.<init>(FileInputStream.java:146)

                  at java.io.FileInputStream.<init>(FileInputStream.java:101)

                  at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)

                  ... 110 more

             

             

             

             

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

             

             

             

             

            Results :

             

             

             

             

            Tests in error:

             

             

            com.myapp.[AnnotatedEchoServletTestCase][1]: Error starting AppEngine.

             

             

             

             

            It seems it could not locate: `com.google.apphosting.utils.config.AppEngineConfigException: Could not locate /tmp/servlet-test.war/WEB-INF/appengine-web.xml`

             

             

            Where its in `/src/main/webapp/WEB-INF` and `/src/test/webapp/WEB-INF`

             

             

             

             

              [1]: https://github.com/arquillian/arquillian-showcase/blob/master/servlet/src/test/java/com/acme/servlet/AnnotatedEchoServletTestCase.java