使用maven jetty插件的类CastException
有人知道是什么导致了以下使用maven jetty插件的类CastException,maven,servlets,jetty,classcastexception,maven-jetty-plugin,Maven,Servlets,Jetty,Classcastexception,Maven Jetty Plugin,有人知道是什么导致了以下ClassCastException:org.eclipse.jetty.server.Request无法转换为org.eclipse.jetty.server.Request 这发生在我的HttpServlet的doGet(HttpServletRequest-req,…)中,当我尝试:Request-baseRequest=(Request)req <plugin> <groupId>org.mortbay.jetty</grou
ClassCastException:org.eclipse.jetty.server.Request无法转换为org.eclipse.jetty.server.Request
这发生在我的HttpServlet
的doGet(HttpServletRequest-req,…)
中,当我尝试:Request-baseRequest=(Request)req代码>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<jettyXml>src/main/webapp/WEB-INF/jetty.xml</jettyXml>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8081</port>
</connector>
</connectors>
<stopPort>18080</stopPort>
<stopKey>STOP</stopKey>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.13</version>
</dependency>
</dependencies>
</plugin>
org.mortbay.jetty
jetty maven插件
8.1.5.v20120716
src/main/webapp/WEB-INF/jetty.xml
8081
18080
停止
mysql
mysql连接器java
5.1.13
您需要确保jetty server没有打包为实际应用程序的一部分;这通常是通过将范围设置为提供:
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
org.eclipse.jetty
jetty服务器
${jetty.version}
假如
您是否检查过运行时jar与编译时jar是否不同?一切都应该是一样的,因为我使用jetty插件在本地运行它。我怎样才能证实这一点?