Search
Calendar
August 2017
S M T W T F S
« Sep    
 12345
6789101112
13141516171819
20212223242526
2728293031  
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>