解决jetty7.0.pre5启动时报ClassNotFoundException: javax.interceptor.InvocationContext异常的问题
问题描述:
最近项目在使用maven命令行运行jetty服务器时出现ClassNotFoundException: javax.interceptor.InvocationContext异常
解决方案:
更换jetty插件的版本
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<webApp>target/iris-0.0.1-SNAPSHOT.war</webApp>
<connectors>
<connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8087</port>
</connector>
</connectors>
<stopKey>exit</stopKey>
<stopPort>8081</stopPort>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
<!-- 简单配置写法 -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<webAppSourceDirectory>${basedir}/src/main/webapp</webAppSourceDirectory>
</configuration>
</plugin>