2015-01-26 21:17 GMT+03:00 Romain Manni-Bucau <rmannibu...@gmail.com>:
> Hi guys,
>
> since I upgraded to 8.0.18 I get:
>
> SEVERE: Servlet.service() for servlet [jsp] in context with path
> [/test] threw exception [javax.el.ELException: The class
> [java.util.Iterator] must be public, non-abstract and not an
> interface] with root cause
> javax.el.ELException: The class [java.util.Iterator] must be public,
> non-abstract and not an interface
> at javax.el.ImportHandler.findClass(ImportHandler.java:171)
> at javax.el.ImportHandler.importClass(ImportHandler.java:111)

1. Your stacktrace (the above lines) does not match the source code of
current Tomcat 8.0.x and thus of 8.0.18.

2. Reproduction recipe is needed. I cannot reproduce the issue with a
simple example of importing and using an Iterator.

If it is reproducible, it needs a ticket in Bugzilla.

3. By the way:
On a reflection, I wonder why ImportHandler.resolveClass(),
resolveStatic() methods have to reject classes that are abstract or
interfaces.

My points:
1) An interface and an abstract class both can declare constants (static fields)
2) An abstract class can declare static methods.

http://docs.oracle.com/javaee/7/api/javax/el/ImportHandler.html


> at 
> org.apache.jasper.runtime.PageContextImpl.getELContext(PageContextImpl.java:954)
> at org.apache.jsp.setup_jsp._jspx_meth_c_005fset_005f0(setup_jsp.java:261)
> at org.apache.jsp.setup_jsp._jspService(setup_jsp.java:136)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at 
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:431)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
>
> with 
> http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/moviefun/src/main/webapp/setup.jsp
> (this line: for (Iterator<Movie> iterator = movies.iterator();
> iterator.hasNext(); ))
>
> Is it expected? not sure I get why interfaces are forbidden in
> particular with <%@ page import="java.util.Iterator" %>
>
> I saw indirectly https://java.net/jira/browse/JSP-44 but this is not
> the cause, any pointer?

The feature request mentioned there:
https://issues.apache.org/bugzilla/show_bug.cgi?id=57142

>
> will a flag be introduced for existing apps?

Nobody has requested such a feature.

1. Is there a valid use case?
2. Detailed requirements = ? Explicit imports are controlled by Jasper
generating the code, but what about implicit imports (java.lang.*,
javax.servlet.* etc.) - are they affected or not?


2015-01-26 22:46 GMT+03:00 Mark Thomas <ma...@apache.org>:
>
> That code hasn't changed 8.0.17 -> 8.0.18 (I don't think) but it did
> change in a previous version.
>

Violletta fixed an issue there - the classes imports were not processed
http://svn.apache.org/viewvc?view=revision&revision=r1653830

Best regards,
Konstantin Kolinko

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

Reply via email to