使用jetty-maven-plugin时,在Jetty 8到jetty 9迁移时,由于类强制转换异常,应用程序无法加载:
java.lang.ClassCastException:org.eclipse.jetty.webapp.WebAppContext 无法转换为org.eclipse.jetty.maven.plugin.JettyWebAppContext
答案 0 :(得分:0)
将上下文处理程序从WebAppContext更改为JettyWebApp上下文。
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.maven.plugin.JettyWebAppContext">
<war>../../flieName.war</war>
<contextPath>/yourPath</contextPath>
</contextHandler>
<contextHandler implementation="org.eclipse.jetty.maven.plugin.JettyWebAppContext">
<war>../../yourWar.war</war>
<contextPath>/anotherPath</contextPath>
</contextHandler>
<contextHandler implementation="org.eclipse.jetty.maven.plugin.JettyWebAppContext">
<war>../../../anotherApp.war</war>
<contextPath>/oneMorePath</contextPath>
</contextHandler>
同样对您的jetty-context.xml进行相同的更改
<Configure class="org.eclipse.jetty.maven.plugin.JettyWebAppContext">