我用Vaadin 7,和vaadin有一个默认的包javax.servlet
,我需要在我的依赖其中包含另一个javax.servlet
com.google.gwt
。当我运行我的应用程序,我得到这个错误:从com.google.gwt依赖排除javax.servlet包上的pom.xml
SEVERE: Allocate exception for servlet Vaadin Application Servlet
java.lang.ClassCastException: com.vaadin.server.VaadinServlet cannot be cast to javax.servlet.Servlet
现在我想从这种依赖排除的javax.servlet,这里就是我试过到目前为止:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.6.1</version>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
这:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<minimizeJar>true</minimizeJar>
<artifact>com.google.gwt:gwt-user</artifact>
<includes>
<include>com/google/**</include>
</includes>
<excludes>
<exclude>javax/servlet/**</exclude>
<exclude>javax/servlet/http/**</exclude>
<exclude>javax/servlet/resources/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
但两者没有工作!帮帮我!
它的工作,非常感谢!你能否在你的文章中解释'gwt-sevlet'和'gwt-user'之间的区别? – deltascience