On 28/04/2020 07:02, Markus Fömpe wrote: > Hi, > > With Tomcat 9.0.34 the JDT compiler was updated to 4.15. > Since then, there is an error when Tomcat compiles the JSP at runtime when > this construct is used in a JSP:
Not good news but thanks for bring this up. We skipped 4.14 because there was a compilation error with the Tomcat source code. I hope this isn't another issue with JDT. I'll start looking into this. > <%@ page import="java.util.List"%> > <%@ page import="java.util.ArrayList"%> > <% > class InnerClass { > // some class members > } > > List<InnerClass> list = new ArrayList<>(); > > for(InnerClass elements : list) { > // do sth > } > %> > > > This is root cause: > > java.lang.ClassCastException: class > org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding cannot be cast > to class org.eclipse.jdt.internal.compiler.lookup.TypeBinding > (org.eclipse.jdt.internal.compiler.lookup.PlainPackageBinding and > org.eclipse.jdt.internal.compiler.lookup.TypeBinding are in unnamed module of > loader java.net.URLClassLoader @20398b7c) Which Java version are you using here? <snip/> > If the JSP is precompiled using an ant task and the JDT compiler, the error > doesn’t occur: <snip/> > I know that the error is within the JDT Stacktrace, but because this error > doesn’t occur when using the JDT for compiling the generated Java file, I > assume that this problem is related to a Tomcat configuration. That seems like a reasonable conclusion. > I use the docker image tomcat:9.0.34. Just to note that the ASF doesn't provide Docker images. It seems unlikely but if we can't reproduce this with a clean install of Apache Tomcat as provided by the ASF, you might need to take this up with the provider of that image. > If required I can also provide the Java source generated from the JSP. Thanks. I don't need it yet. I'll ping this thread if that changes. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org