我从apache页面下载了"Spring + Shiro + myBatis + JSR-303验证“示例,我想使用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 :run之后,我尝试在示例中注册一个用户,我得到了一个例外:"java.lang.ClassCastException: org.apache.shiro.web.servlet.ShiroHttpSession不能转换到org.mortbay.jetty.servlet.AbstractSessionManager$SessionIf",,任何人都可以告诉我原因,而且很多情况都是这样。
发布于 2012-06-11 15:49:53
很可能无法将ShiroHttpSession转换为抽象SessionIf$SessionIf,因为它不是它的一个实例。这看起来像Jetty的窃听器。我复制了这个版本,然后将jetty插件升级到6.1.26版本,错误就消失了。
https://stackoverflow.com/questions/10966504
复制相似问题