perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.65k stars 1.56k forks source link

Spark 2.5.2 and Servlet API jar #711

Closed vasyas closed 7 years ago

vasyas commented 8 years ago

I'm using Spark 2.5.2 in embedded mode with a Maven dependency: com.sparkjava:spark-core:compile:2.5.2

But my app is not starting: java.lang.NoClassDefFoundError: javax/servlet/Filter

That's probably due to missing transitive dependency on Servlet API.

I was trying to add different different API jars, but didn't found one to be working with Spark. For example, org.apache.geronimo.specs:geronimo-servlet_3.0_spec:compile:1.0 says: java.lang.ClassNotFoundException: javax.servlet.http.HttpSessionIdListener

Which Servlet API jar should I use with Spark ?

jakaarl commented 7 years ago

Spark's Jetty dependency should bring the Servlet API dependency with it. Can you check with mvn dependency:tree what dependencies your project has? I suspect there are conflicting versions of Servlet API in your class path.