神秘的 jetty-maven-plugin 错误消息 'ERROR: PWC6117: File “null”没有找到
我有一个 Maven Web 应用程序生成 WAR 文件。 我刚刚将 Jetty 插件升级到 7.4.2.v20110526(从 6.x 开始)。我进行了以下设置:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.4.2.v20110526</version>
<executions>
<execution>
<id>jetty-run</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<connectors>
<connector implementation="${connector}">
<port>80</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppConfig>
<contextPath>/foo</contextPath>
</webAppConfig>
<webappDirectory>${project.build.directory}/foo</webappDirectory>
<scanIntervalSeconds>10</scanIntervalSeconds>
<systemProperties>
<systemProperty>
<name>logback.configurationFile</name>
<value>file:${basedir}/target/${project.artifactId}-${project.version}/WEB-INF/classes/logback.xml</value>
</systemProperty>
</systemProperties>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
</dependencies>
</plugin>
由于一些我不清楚的原因,我不断收到下面的神秘错误消息:
2011-07-07 11:51:16.431:WARN::Aliased resource: file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp~=file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp
2011-07-07 11:51:16.507:WARN::Aliased resource: file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp~=file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp
ERROR: PWC6117: File "null" not found
没有例外,但是我无法登录到 web 应用程序。
但是,如果我获取生成的 war 文件并将其部署到干净的 Jetty 安装中,它就可以完美运行。这是怎么回事……?我的意思是,这曾经与 6.x 插件一起使用。没有任何代码更改。
展开的目录的内容与 war 文件中的内容完全相同 - 我检查过 - 没有丢失文件或任何明显的差异。
这是一个 Spring Web 项目。
有什么想法吗?有人见过这个吗?
非常感谢!
I have a Maven Webapp producing a WAR file.
I've just upgraded my Jetty plugin to the 7.4.2.v20110526 (from 6.x). I have the following set up:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.4.2.v20110526</version>
<executions>
<execution>
<id>jetty-run</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<connectors>
<connector implementation="${connector}">
<port>80</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppConfig>
<contextPath>/foo</contextPath>
</webAppConfig>
<webappDirectory>${project.build.directory}/foo</webappDirectory>
<scanIntervalSeconds>10</scanIntervalSeconds>
<systemProperties>
<systemProperty>
<name>logback.configurationFile</name>
<value>file:${basedir}/target/${project.artifactId}-${project.version}/WEB-INF/classes/logback.xml</value>
</systemProperty>
</systemProperties>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
</dependencies>
</plugin>
For some unclear to me reason, I keep getting the cryptic error message below:
2011-07-07 11:51:16.431:WARN::Aliased resource: file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp~=file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp
2011-07-07 11:51:16.507:WARN::Aliased resource: file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp~=file:/java/foo/branches/stable/modules/foo-web/src/main/webapp/WEB-INF/jsps/main.jsp
ERROR: PWC6117: File "null" not found
There is no exception, however I cannot log in to the webapp.
However, if I grab the produced war file and deploy it into a clean Jetty installation, it works perfectly. What's the deal here...? I mean, this used to work with the 6.x plugin. No code changes whatsoever.
The contents of the exploded directory are exactly the same as the ones in the war file - I checked -- there are no missing files or any obvious differences.
This is a Spring Web project.
Any ideas? Has anybody seen this before?
Many thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保您的 ModelAndView-s 在控制器中正确映射:
Make sure your ModelAndView-s are mapped properly in your controller:
就我而言,@tftd 提供的上述解决方案不起作用,因此我注释掉了 defaultHandler 属性,然后错误日志消失了。
In my case, above solution @tftd provided did not work so I commented out defaultHandler property, then error log disappeared.
确保您已导入org.springframework.web.servlet.ModelAndView。一旦我通过导入org.springframework.web.portlet.ModelAndView遇到了这个问题。
Make sure you have imported org.springframework.web.servlet.ModelAndView. Once i had got this problem by importing org.springframework.web.portlet.ModelAndView.