2012-06-10 47 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,错误消失了。