本文介绍了使用GAE / Arquillian运行Servlet测试中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 $ mvn -Dtest = AnnotatedEchoServletTestCase test -Dappengine.sdk.root = / home / xybrek / buildtools / appengine-java-sdk-1.8.4 这是日志: 测试 运行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 / cla sses / 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:获取临时根目录:/ tmp Mar 07,2014 6 :15:21 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml SEVERE:收到异常处理/tmp/servlet-test.war/WEB-INF/appengine-web.xml com。 google.apphosting.utils.config.AppEngineConfigException:无法在com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream找到/tmp/servlet-test.war/WEB-INF/appengine-web.xml ( AppEngineWebXmlReader.java:140),位于com.google.apphosting.utils.config.AppEngineWebXmlReader.readAp pEngineWebXml(AppEngineWebXmlReader.java:75),位于com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:166)位于com.google.appengine.tools.development.ApplicationConfigurationManager $ WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:399),位于com.google.appengine.tools.development.ApplicationConfigurationManager。< init>(ApplicationConfigurationManager.java:146) com.google.appengine.tools .development.ApplicationConfigurationManager.newWarConfigurationManager(ApplicationConfigurationManager.java:88)位于com.google.appengine.tools.development.DevAppServerImpl。< init>(DevAppServerImpl.java:137) at sun.reflect。 NativeConstructorAccessorImpl.newInstance0(本机方法)在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)。在Ĵ ava.lang.reflect.Constructor.newInstance(Constructor.java:526)在org.jboss.arquillian.container.appengine.embedded.hack.DevAppServerFactoryHack.createDevAppServer(DevAppServerFactoryHack.java:36)。在org.jboss.arquillian.container.appengine.embedded.hack.DevAppServerFactoryHack.createDevAppServer(DevAppServerFactoryHack.java:25)在org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer $ 1.run(AppEngineEmbeddedContainer.java: at org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer $ 1.run(AppEngineEmbeddedContainer.java:66) at java.security.AccessController.doPrivileged(Native Method)在org.jboss.arquillian.container.appengine.embedded.AppEngineEmbeddedContainer.doDeploy(AppEngineEmbeddedContainer.java:66) at org.jboss.arquillian.container.common.AppEngineCommonContainer.deploy(AppEngineCommonContainer.java:94)$ b $ org.jboss.arquillian.container.impl.client.container.ContainerDeployCont $ 3.call(ContainerDeployController.java:161)在org.jboss.arquillian.container.impl.client.container.ContainerDeployController $ 3.call(ContainerDeployController.java:128)在org.jboss。 arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)在org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)。在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在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.EventCo ntextImpl.proceed(EventContextImpl.java:81) at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50) at sun.reflect.NativeMethodAccessorImpl。 invoke0(本机方法)处是java sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 。 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)处sun.reflect org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)。 NativeMethodAccessorImpl.invoke0(本机方法) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a: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)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606)在org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)在org.jboss.arq uillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)位于org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)位于org.jboss。 arquillian.core.impl.EventImpl.fire(EventImpl.java:67) at org.jboss.arquillian.container.impl.client.container.ContainerDeployController $ 1.perform(ContainerDeployController.java:95)在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(本机方法) at sun.refle ct.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: at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java: at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606)在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)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在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)在org.jboss.arquillian.core.impl.EventCon textImpl.proceed(EventContextImpl.java:88)在org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)处的java.lang.reflect sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)。 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)位于org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)位于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 。评估(Arquillian.java:182)$ or 。 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)在org.junit.runners.ParentRunner.run(ParentRunner.java:309)在org.jboss.arquillian.junit.Arquillian。运行(Arquillian.java:147)在org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)在org.apache.maven.surefire.junit4.JUnit4Provider。 $ sudoTestSet(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。在org.apache.maven.surefire.util.Re中调用(Method.java:606) flectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)在org.apache.maven.surefire.booter.ProviderFactory $ ProviderProxy.invoke(ProviderFactory.java:110)在org.apache.maven.surefire。 booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)在org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)在org.apache.maven.surefire。 booter.ForkedBooter.main(ForkedBooter.java:68)导致:java.io.FileNotFoundException:/tmp/servlet-test.war/WEB-INF/appengine-web.xml(没有这样的文件或目录) 在java.io.FileInputStream.open(Native Method)在java.io.FileInputStream。< init>(FileInputStream.java:146)在java.io.FileInputStream。< ; init>(FileInputStream.java:101) at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137) ... 110 more 测试运行:1,失败:0,错误:1,Skippe d:0,经过的时间:2.826秒 结果: 错误测试: com.myapp。 AnnotatedEchoServletTestCase :启动AppEngine时出错。 看起来它找不到: com.google.apphosting.utils。 config.AppEngineConfigException:无法找到/tmp/servlet-test.war/WEB-INF/appengine-web.xml 其中 / src / main / webapp / WEB-INF 和 / src / test / webapp / WEB-INF 解决方案看起来你并没有将appengine-web.xml文件打包到ShrinkWrap的存档中。I tried to run with:$ mvn -Dtest=AnnotatedEchoServletTestCase test -Dappengine.sdk.root=/home/xybrek/buildtools/appengine-java-sdk-1.8.4This is the log: T E S T SRunning com.myapp.AnnotatedEchoServletTestCaseMar 07, 2014 6:15:20 PM org.jboss.arquillian.container.appengine.embedded.AppEngineSetup prepareINFO: 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.classMar 07, 2014 6:15:20 PM org.jboss.arquillian.container.common.AppEngineCommonContainer$1 runINFO: Get temp root: /tmpMar 07, 2014 6:15:21 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXmlSEVERE: Received exception processing /tmp/servlet-test.war/WEB-INF/appengine-web.xmlcom.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 moreTests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.826 sec <<< FAILURE!Results :Tests in error: com.myapp.AnnotatedEchoServletTestCase: 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.xmlWhere its in /src/main/webapp/WEB-INF and /src/test/webapp/WEB-INF 解决方案 It looks like you're not packaging the appengine-web.xml file into ShrinkWrap's archive. 这篇关于使用GAE / Arquillian运行Servlet测试中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-26 18:58