![]() |
![]() |
||||
This page shows errors where a java.lang.LinkageError error is thrown and how to fix them.
Table of Contents
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.jasper.compiler.JspRuntimeContext.<init>(Ljavax/servlet/ServletContext;Lorg/apache/jasper/Options;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/apache/jasper/servlet/JspServlet, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, org/apache/jasper/compiler/JspRuntimeContext, have different Class objects for the type org/apache/jasper/Options used in the signature org.apache.jasper.servlet.JspServlet.init(JspServlet.java:76) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) ...
This error occurs when two classloaders have loaded the same class with different signatures.
ie: you have the same class twice in your CLASSPATH, but the classes are different (usually different versions).
Usually, the reason is that you have included a JAR file in your WEB-INF/lib or WAR file, which is already part of the JVM or Servlet Container (such as jsp-api.jar).
See: JAR files you should never include in your webapp
To fix: remove the offending jar files from your app.
See Also: javax.servlet.ServletException, if this exception is preceded by a ServletException: loader constraint violation exception.