简体   繁体   English

GWT无法通过找不到appengine-web.xml开始

[英]GWT not starting by not finding appengine-web.xml

I'm dealing with a problem that I know where the problem is, but I don't know how to fix it. 我正在处理一个问题,我知道问题在哪里,但我不知道如何解决。 When I try to run the development server using Run As -> Web Application, I get the following error on the console: 当我尝试使用运行方式-> Web应用程序运行开发服务器时,在控制台上出现以下错误:

Initializing App Engine server
Feb 07, 2014 8:39:07 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing C:\Users\JOSR\Last Hope\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate C:\Users\JOSR\Last Hope\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:139)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:258)
at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:36)
at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:226)
at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:224)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:224)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:60)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: java.io.FileNotFoundException: C:\Users\JOSR\Last Hope\WEB-INF\appengine-web.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)
... 23 more

I know that the path "C:\\Users\\JOSR\\Last Hope\\WEB-INF/appengine-web.xml" is wrong, should be "C:\\Users\\JOSR\\Last Hope\\war/WEB-INF/appengine-web.xml", but I don't know where to change it or how to force GWT to use the proper war path. 我知道路径“ C:\\ Users \\ JOSR \\ Last Hope \\ WEB-INF / appengine-web.xml”错误,应为“ C:\\ Users \\ JOSR \\ Last Hope \\ war / WEB-INF / appengine- web.xml”,但我不知道在哪里更改它或如何强制GWT使用正确的战争路径。 Any ideas? 有任何想法吗?

Thanks for reading! 谢谢阅读!

from context-menu 从上下文菜单

Run As/Run Configuration and select your html ,choose Arguments tab 运行方式/运行配置,然后选择html,选择Arguments标签

-war option is that. -war选项就是那个。

I faced the same problem when I started using Maven in a GWT-GAE project. 在GWT-GAE项目中开始使用Maven时,我遇到了同样的问题。

In my case this problem happened because the eclipse launch file tries to load the appengine-web.xml from target/myproject/WEB-INF/appengine-web.xml but the files are in src/main/webapp/WEB-INF . 在我的情况下,发生此问题是因为Eclipse启动文件试图从target/myproject/WEB-INF/appengine-web.xml加载appengine-web.xml,但是文件位于src/main/webapp/WEB-INF

The solution is to uncheck the option "Launch and deploy from this directory (disabled because this is a Maven project)" from your project properties in Eclipse, even if this is really a maven project, like in the picture the option "WAR directory:" should point src/main/webapp 解决方案是从Eclipse中的项目属性中取消选中“从此目录启动并部署(由于这是Maven项目而被禁用)”选项,即使它确实是一个Maven项目,如图中的“ WAR目录: ”应指向src/main/webapp

Important ! 重要 Keep in mind, you have to build the project using maven before running the launch file, otherwise the folder target/myproject/WEB-INF/ will be empty. 请记住,您必须在运行启动文件之前使用maven构建项目,否则文件夹target/myproject/WEB-INF/将为空。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM