2011-07-07 93 views
4

我有一個產生WAR文件的Maven Webapp。 我剛剛將我的Jetty插件升級到7.4.2.v20110526(從6.x開始)。我有以下設置:Cryptic jetty-maven-plugin錯誤信息'ERROR:PWC6117:File「null」not found'

 <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項目。

任何想法?有沒有人看過這個?

非常感謝提前!

回答

7

確保您的ModelAndView-S在您的控制器正確映射:

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

謝謝!這解決了它。 – carlspring

+0

你把它放在哪裏? –

+0

這應該在你的控制器中。 – tftd

2

在我的情況下,上述方案@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> 
-1

確保您已導入org.springframework.web.servlet.ModelAndView。一旦我通過導入org.springframework.web.portlet.ModelAndView得到了這個問題。

相關問題