Cryptic jetty-maven-plugin error message 'ERROR: PWC6117: File "null" not found'
Asked Answered
W

3

5

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!

Worrell answered 7/7, 2011 at 9:10 Comment(0)
F
7

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

return new ModelAndView("WEB-INF/jsps/main");
Frei answered 7/7, 2011 at 14:57 Comment(1)
That should be in your controller.Frei
C
2

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>
Coulter answered 9/3, 2016 at 15:25 Comment(0)
C
1

Make sure you have imported org.springframework.web.servlet.ModelAndView. Once i had got this problem by importing org.springframework.web.portlet.ModelAndView.

Clachan answered 13/2, 2018 at 10:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.