user2739754
user2739754

Reputation: 11

java.lang.ClassNotFoundException: javax.servlet.descriptor.JspConfigDescriptor

I'm trying to build a JSF application, but I'm having this error:

java.lang.ClassNotFoundException: javax.servlet.descriptor.JspConfigDescriptor
java.lang.NoClassDefFoundError: javax/servlet/descriptor/JspConfigDescriptor

How is this caused and how can I solve it?

Upvotes: 1

Views: 3045

Answers (1)

BalusC
BalusC

Reputation: 1109422

java.lang.ClassNotFoundException: javax.servlet.descriptor.JspConfigDescriptor

This class was introduced in Servlet 3.0. This error thus means that your webapp's runtime classpath is littered with arbitrarily downloaded JAR files from a completely different servletcontainer make/version which doesn't support Servlet 3.0, while the webapp is in turn deployed to a Servlet 3.0 compatible container. This would only result in classloading conflicts in all colors because multiple different versioned classes exist in the runtime classpath.

Littering /WEB-INF/lib folder with servletcontainer-specific JAR files is in turn a common starter's mistake in a wild attempt to "fix" compile errors they faced in their IDE. This should have been solved differently. See also How do I import the javax.servlet API in my Eclipse project?

In a nutshell: Never put arbitrarily downloaded servletcontainer-specific JARs in /WEB-INF/lib. Instead, configure your IDE project to set the desired target servletcontainer as "Target Runtime".

Upvotes: 1

Related Questions