Jetty: Java.lang.NoClassDefFoundError: org / apache / jasper / runtime / JspApplicationContextImpl error

I am using Jetty 8 (stable), JDK 1.7. Eclipse Luna.

I am new to using Jetty with Java, I am trying to run the sample code provided in the Tutorial (Tutorial Link )

But I get the following error:

2015-06-24 10:52:03.208:WARN:oejuc.AbstractLifeCycle:FAILED      
org.eclipse.jetty.server.handler.HandlerCollection@6be3fe1e: java.lang.NoClassDefFoundError:  org/apache/jasper/runtime/JspApplicationContextImpl Java.lang.NoClassDefFoundError:org/apache/jasper/runtime/JspApplicationContextImpl

I checked in my maven repository there this folder does not exist. I thought this folder would be automatically created. But after doing a clean build several times, I got the same error.

Do I need to create this folder manually, then I have to try again or for another reason. Please guide me in the right direction.

Here is my pom.xml:

<properties>
<jetty-version>8.1.1.v20120215</jetty-version>
</properties>

<dependencies>
<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-server</artifactId>
  <version>${jetty-version}</version>
</dependency>
</dependencies>

<build>
<plugins>
  <plugin>
    <!-- This plugin is needed for the servlet example -->
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>${jetty-version}</version>
  </plugin>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.1</version>
    <executions>
      <execution><goals><goal>java</goal></goals></execution>
    </executions>
    <configuration>
      <mainClass>org.example.HelloWorld</mainClass>
    </configuration>
  </plugin>
</plugins>
</build>

thank

+4
source share
2 answers

, JRE ​​ 1.5, JDK 1.7. maven - Project-Update . , ( ).

slawas .

0

, :

<dependency>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jsp-2.1</artifactId>
   <version>6.1.14</version>
</dependency>

. http://mvnrepository.com/artifact/org.mortbay.jetty/jsp-2.1

+2

All Articles