You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/11/25 16:13:41 UTC

DO NOT REPLY [Bug 52245] New: Add detection of EL Jar to WebappClassLoader

https://issues.apache.org/bugzilla/show_bug.cgi?id=52245

             Bug #: 52245
           Summary: Add detection of EL Jar to WebappClassLoader
           Product: Tomcat 7
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: bugzilla@pidster.com
    Classification: Unclassified


The EL API is not currently detected by the code in WebappClassLoader.
Applications containing el-api.jar will not start.

(patch to follow).

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52245] Add detection of EL Jar to WebappClassLoader

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52245

--- Comment #2 from Pid <bu...@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52245] Add detection of EL Jar to WebappClassLoader

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52245

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Mark Thomas <ma...@apache.org> 2012-01-12 19:49:45 UTC ---
Thanks for the patch. Applied to trunk and 7.0.x and will be included in 7.0.24
onwards.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52245] Add detection of EL Jar to WebappClassLoader

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52245

--- Comment #3 from Pid <bu...@pidster.com> 2011-11-25 18:00:13 UTC ---
Created attachment 27986
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27986
Simple EL API test case

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52245] Add detection of EL Jar to WebappClassLoader

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52245

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> 2011-11-25 16:02:52 UTC ---
Can you explain what do you mean by this?
What is the actual behaviour and what is expected?

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52245] Add detection of EL Jar to WebappClassLoader

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52245

--- Comment #4 from Pid <bu...@pidster.com> 2011-11-25 18:37:27 UTC ---
Created attachment 27987
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27987
Patch to detect classes in javax.el and avoid loading repository/class

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org