我从 apache shiro doc 页面下载了“ Spring MVC + Shiro + myBatis + JSR-303 Validation ”示例,我想用 maven jetty 插件运行它,所以我打开 pom.xml 并放置这样的东西
<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 jetty:run 启动应用程序,我尝试在示例中注册一个用户,我得到一个异常,例如:“ java.lang.ClassCastException: org.apache.shiro.web.servlet.ShiroHttpSession 不能转换为org.mortbay.jetty.servlet.AbstractSessionManager$SessionIf ",谁能告诉我为什么,谢谢。