神秘的 jetty-maven-plugin 错误消息 'ERROR: PWC6117: File “null”没有找到

发布于 2024-11-19 03:37:09 字数 3039 浏览 7 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

镜花水月 2024-11-26 03:37:09

确保您的 ModelAndView-s 在控制器中正确映射:

return new ModelAndView("WEB-INF/jsps/main");

Make sure your ModelAndView-s are mapped properly in your controller:

return new ModelAndView("WEB-INF/jsps/main");
自在安然 2024-11-26 03:37:09

就我而言,@tftd 提供的上述解决方案不起作用,因此我注释掉了 defaultHandler 属性,然后错误日志消失了。

<bean id="classNameControllerMappings"
      class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
    <property name="caseSensitive" value="true" />
    <property name="order" value="2" />
    <!--property name="defaultHandler">
        <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
    </property-->
</bean>

In my case, above solution @tftd provided did not work so I commented out defaultHandler property, then error log disappeared.

<bean id="classNameControllerMappings"
      class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
    <property name="caseSensitive" value="true" />
    <property name="order" value="2" />
    <!--property name="defaultHandler">
        <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
    </property-->
</bean>
三人与歌 2024-11-26 03:37:09

确保您已导入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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文