2012-06-10 50 views
0

我從網上下載的Apache四郎文檔頁面「Spring MVC + Shiro + myBatis + JSR-303 Validation」的例子,我想與Maven插件碼頭運行它,所以我開的pom.xml,並把這樣的事情使用四郎與MVN碼頭插件

<plugin> 
      <groupId>org.mortbay.jetty</groupId> 
      <artifactId>maven-jetty-plugin</artifactId> 
      <version>6.1.10</version> 
        <configuration> 
          <scanIntervalSeconds>10</scanIntervalSeconds> 
          <stopKey>foo</stopKey> 
          <stopPort>9999</stopPort> 
          <webAppConfig> 
          <contextPath>/</contextPath> 
          </webAppConfig> 
          <scanIntervalSeconds>10</scanIntervalSeconds> 
          <!-- <webAppSourceDirectory></webAppSourceDirectory> --> 
        </configuration> 
        <executions> 
          <execution> 
            <id>start-jetty</id> 
            <phase>pre-integration-test</phase> 
            <goals> 
              <goal>run</goal> 
            </goals> 
            <configuration> 
              <scanIntervalSeconds>0</scanIntervalSeconds> 
              <daemon>true</daemon> 
            </configuration> 
          </execution> 
          <execution> 
            <id>stop-jetty</id> 
            <phase>post-integration-test</phase> 
            <goals> 
              <goal>stop</goal> 
            </goals> 
          </execution> 
        </executions> 
      </plugin> 

之後,我啓動應用程序使用mvn碼頭:運行,我嘗試註冊一個用戶的例子,我得到一個異常喜歡: 「java.lang.ClassCastException:org.apache.shiro.web.servlet.ShiroHttpSession can not被轉換爲org.mortbay.jetty.servlet.AbstractSessionManager $ SessionIf「,誰能告訴我爲什麼,而thx很多。

回答

0

很可能ShiroHttpSession不能轉換爲AbstractSessionManager $ SessionIf,因爲它不是它的一個實例。這看起來像是Jetty中的一個錯誤。我重現了這一點,然後將jetty插件升級到版本6.1.26,錯誤消失了。