Details
-
Dependency upgrade
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.6.1
-
Tomcat 7.x
Tested on Mac OS X 10.6.8
Description
libthrift 0.6.1 pom (org.apache.thrift:libthrift-0.6.1) specifies javax.servlet:servlet-api-2.5 as compulsory dependency. This causes the jar depending on this libthrift to be skipped by Tomcat with the following error:
INFO: validateJarFile(/usr/local/apache-tomcat-7.0.2/webapps/mywebapp/WEB-INF/lib/my-service-1.0.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Workaround
While including libthrift-0.6.1 as dependency in maven pom, exclude javax.servlet:servlet-api using exclusions as:
<dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.6.1</version> <exclusions> <exclusion> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> </exclusions> </dependency>