Search
Calendar
May 2017
S M T W T F S
« Sep    
 123456
78910111213
14151617181920
21222324252627
28293031  
Your widget title
Archives

Posts Tagged ‘ServletRequestListener’

PostHeaderIcon Maven / Jetty 7 / java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener

Case

My project is deployed via Maven on a Jetty 6 server. I have to upgrade the server to Jetty 7.
(BTW: notice that the plugin maven-jetty-plugin was renamed as jetty-maven-plugin)

I get this error:

java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener

Quick Fix

In Jetty plugin, add a dependency to servlet-api, eg:

          <plugin>
              <groupId>org.mortbay.jetty</groupId>
              <artifactId>jetty-maven-plugin</artifactId>
              <version>7.4.4.v20110707</version>
              <dependencies>
                  <dependency>
                      <groupId>javax.servlet</groupId>
                      <artifactId>servlet-api</artifactId>
                      <version>2.4</version>
                  </dependency>
              </dependencies>