Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1257

thrift's dependency scope on javax.servlet:servlet-api should be 'provided'

    XMLWordPrintableJSON

Details

    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>
      

      Attachments

        1. thrift-1257.patch
          0.7 kB
          Jake Farrell

        Activity

          People

            jfarrell Jake Farrell
            shashwat Shashwat Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: