我最近将我的GWT + App Engine项目设置从单个模块maven项目更改为多模块maven项目:
我的项目使用mvn install
(在父项上)构建,没有错误,只要整个项目已经编译,它运行正常。
但是,我需要在Mojo gwt-maven-plugin的配置中使用<superDevMode>false</superDevMode>
才能执行此操作。这是我的一些pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt-maven-plugin.version}</version>
<configuration>
<strict>true</strict>
<testTimeOut>180</testTimeOut>
<!-- With multiple tests use GwtTestSuite.java for speed -->
<includes>**/*GwtTest.java</includes>
<mode>htmlunit</mode>
<logLevel>INFO</logLevel>
<style>PRETTY</style>
<copyWebapp>true</copyWebapp>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<server>com.google.appengine.tools.development.gwt.AppEngineLauncher</server>
<appEngineVersion>${gae.version}</appEngineVersion>
<extraJvmArgs>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=10 -Xmx2g -Dappengine.sdk.root=${mvn.gae.home}
</extraJvmArgs>
<!--<port>8888</port>-->
<superDevMode>false</superDevMode>
<!--<incremental>true</incremental>-->
<!--<bindAddress>0.0.0.0</bindAddress>-->
<runTarget>Project.html</runTarget>
<modules>
<module>com.utilitiessavings.usavappv7.Project</module>
</modules>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
如果我打开SDM,启动时似乎没有任何错误(使用gwt:run
):
[INFO] --- gwt-maven-plugin:2.8.0-rc1:run (default-cli) @ UsavAppV7 ---
[INFO] create exploded Jetty webapp in C:\Users\Drew\IntelliJ\UsavApp\app\target\UsavAppV7-1.0-SNAPSHOT
[INFO] extract appengine 1.9.40 sdk to C:\Users\Drew\IntelliJ\UsavApp\app\target\appengine-sdk
[INFO] Super Dev Mode starting up
[INFO] workDir: C:\Users\Drew\AppData\Local\Temp\gwt-codeserver-4487617494656562585.tmp
[ERROR] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[ERROR] SLF4J: Defaulting to no-operation (NOP) logger implementation
[ERROR] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Loading Java files in com.utilitiessavings.usavappv7.Project.
[INFO] Module setup completed in 16220 ms
[INFO]
[INFO] The code server is ready at http://127.0.0.1:9876/
[ERROR] Aug 16, 2016 4:35:26 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
[ERROR] INFO: Overwriting system property key 'java.util.logging.config.file', value 'C:\Users\Drew\.m2\repository\com\google\appengine\appengine-java-sdk\1.9.40\appengine-java-sdk\appengine-java-sdk-1.9.40\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'C:\Users\Drew\IntelliJ\UsavApp\app\target\UsavAppV7-1.0-SNAPSHOT\WEB-INF\appengine-web.xml'
[ERROR] Aug 16, 2016 4:35:26 PM com.google.apphosting.utils.jetty.JettyLogger info
[ERROR] INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
[ERROR] Aug 16, 2016 3:35:27 PM com.google.appengine.tools.development.IsolatedAppClassLoader checkWorkingDirectory
[ERROR] WARNING: Your working directory, (C:\Users\Drew\IntelliJ\UsavApp\app) is not equal to your
[ERROR] web application root (C:\Users\Drew\IntelliJ\UsavApp\app\target\UsavAppV7-1.0-SNAPSHOT)
[ERROR] You will not be able to access files from your working directory on the production server.
[ERROR]
[ERROR] Aug 16, 2016 3:35:27 PM com.google.apphosting.utils.jetty.JettyLogger info
[ERROR] INFO: jetty-6.1.x
[INFO] ChatServiceImpl constructed
[INFO] BlobServiceImpl constructed
[INFO] UploadPricesServlet constructed
[ERROR] Aug 16, 2016 3:35:30 PM com.google.apphosting.utils.jetty.JettyLogger info
[ERROR] INFO: Started SelectChannelConnector@0.0.0.0:8888
[ERROR] Aug 16, 2016 3:35:30 PM com.google.appengine.tools.development.AbstractModule startup
[ERROR] INFO: Module instance default is running at http://localhost:8888/
[ERROR] Aug 16, 2016 3:35:30 PM com.google.appengine.tools.development.AbstractModule startup
[ERROR] INFO: The admin console is running at http://localhost:8888/_ah/admin
[ERROR] Aug 16, 2016 4:35:30 PM com.google.appengine.tools.development.DevAppServerImpl doStart
[ERROR] INFO: Dev App Server is now running
但是当我打开localhost:8888时,我得到&#34;无法从超级开发模式加载项目&#34; 错误:
如果我转到http://localhost:9876,我会看到此消息:
HTTP错误:500
访问/的问题。原因是:
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getHeader(Ljava /郎/字符串;)Ljava /郎/字符串;
我在这里创建了一个包含5个pom.xml文件的要点:https://gist.github.com/slugmandrew/1d9acf86be2c7db89031dc60de9df6e2
Google网上论坛帖子:https://groups.google.com/forum/#!topic/google-web-toolkit/dF8KhbxnlBY
答案 0 :(得分:3)
HttpServletResponse的getHeader方法是Servlet 3.0 API的一部分。检查你的类路径是否有旧版本的Servlet API,即冲突的GWT版本jar(2.6 vs 2.7),冲突的Jetty jar或冲突的servlet-api jar。