https://issues.apache.org/bugzilla/show_bug.cgi?id=52245
--- Comment #2 from Pid <bugzi...@pidster.com> 2011-11-25 17:58:36 UTC ---
(In reply to comment #1)
> Can you explain what do you mean by this?

(Sorry, I wanted to put an initial report in so I wouldn't forget.)

WebappClassLoader detects classes in certain packages/JARs (e.g.
java.servlet.*) that are supplied by the container and won't load them, as per
SRV.9.7.2.

> What is the actual behaviour and what is expected?

A simple application is attached. It will start, (my mistake earlier), but
throws an exception when a JSP is accessed. The application contains el-api.jar
in WEB-INF/lib.

The exception is:

javax.servlet.ServletException: java.lang.LinkageError: loader constraint
violation: when resolving interface method
"javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;"
the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the
current class, org/apache/jsp/index_jsp, and the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for resolved class,
javax/servlet/jsp/JspApplicationContext, have different Class objects for the
type javax/el/ExpressionFactory used in the signature
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:342)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause:

java.lang.LinkageError: loader constraint violation: when resolving interface
method
"javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;"
the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the
current class, org/apache/jsp/index_jsp, and the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for resolved class,
javax/servlet/jsp/JspApplicationContext, have different Class objects for the
type javax/el/ExpressionFactory used in the signature
    org.apache.jsp.index_jsp._jspInit(index_jsp.java:31)
    org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
   
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:181)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


The javax.el package is not detected by WebappClassLoader, unlike the
javax.servlet package - which causes JARs to be ignored by the class loader.

SRV 9.7.2 suggests that classes discovered in the application classpath, but
from the javax.el * packages should not be loaded by the WebappClassLoader as
they are provided by the container.


* and possibly javax.annotation and javax.persistence, if the
annotation-api.jar contains all of the classes, as opposed to a subset.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to