-
1. Re: Failed to compile JSP containing Java 7 syntax
jaikiran Jul 25, 2014 9:55 AM (in response to jessholle)Please post the entire exception stacktrace as well as the relevant part from your JSP where you are using the Java 7 syntax.
By the way, have you tried this against 8.1.0.Final? Does it work there?
-
2. Re: Failed to compile JSP containing Java 7 syntax
jessholle Jul 25, 2014 12:32 PM (in response to jaikiran)I don't believe the exception itself is relevant. My issue is that JBoss is clearly not accepting Java 7 syntax in my JSP and my attempts to configure the JSP engine, while clearly evident in JMX MBeans, are failing to influence the JSP compiler's actual behavior.
That said, with a test JSP that simply uses Java 7's diamond operator:
<%
java.util.List<String> list = new java.util.ArrayList<>();
list.add( "hello world" );
out.println( list );
%>
I get the following error:
2014-07-25 11:25:47,047 ERROR [io.undertow.request] (default task-5) UT005023: Exception handling request to /ServiceCenter/wtcore/java7test.jsp: org.apache.jasper.JasperException: JBWEB004062: Unable to compile class for JSP:
JBWEB004060: An error occurred at line: 2 in the jsp file: /wtcore/java7test.jsp
Type mismatch: cannot convert from ArrayList<?> to List<String>
1: <%
2: java.util.List<String> list = new java.util.ArrayList<>();
3: list.add( "hello world" );
4: out.println( list );
5: %>
JBWEB004060: An error occurred at line: 2 in the jsp file: /wtcore/java7test.jsp
Cannot instantiate the type ArrayList<?>
1: <%
2: java.util.List<String> list = new java.util.ArrayList<>();
3: list.add( "hello world" );
4: out.println( list );
5: %>
JBWEB004060: An error occurred at line: 2 in the jsp file: /wtcore/java7test.jsp
Syntax error on token "<", ? expected after this token
1: <%
2: java.util.List<String> list = new java.util.ArrayList<>();
3: list.add( "hello world" );
4: out.println( list );
5: %>
JBWEB004211: Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:69) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:339) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:326) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:604) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) [jastow-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66) [guice-servlet.jar:]
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168) [guice-servlet.jar:]
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) [guice-servlet.jar:]
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) [guice-servlet.jar:]
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) [guice-servlet.jar:]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
.... application filters follow .....
P.S. Wildfly 8.1.0 is kind of out of the picture at the moment for me.
-
3. Re: Failed to compile JSP containing Java 7 syntax
ctomc Jul 25, 2014 7:00 PM (in response to jessholle)This looks like some strange bug as it should work without any issue.
can you please create bug in WildFly - JBoss Issue Tracker report with simple case to reproduce it.
thank you.
-
4. Re: Failed to compile JSP containing Java 7 syntax
ctomc Jul 25, 2014 7:01 PM (in response to ctomc)Ah never mind, just noticed you are talking about 8.0.0.
Before creating bug report can you verify first that it also doesn't work in 8.1.0.
As we did a major compiler upgrade in 8.1 to make it support java 8 syntax.
-
5. Re: Failed to compile JSP containing Java 7 syntax
jessholle Jul 25, 2014 7:40 PM (in response to ctomc)Of course, 8.0.0 should have worked with Java 7 syntax, right?
Java 8 syntax I certainly wouldn't expect to work until 8.1.0.
-
6. Re: Failed to compile JSP containing Java 7 syntax
ctomc Jul 26, 2014 6:22 AM (in response to jessholle)Jess Holle wrote:
Of course, 8.0.0 should have worked with Java 7 syntax, right?
Java 8 syntax I certainly wouldn't expect to work until 8.1.0.
Not really, we had some mash-up with what compiler was used, proper one supporting the JDK7 was used in build, but it never ended up in end result distro.
where really old one was used...
-
7. Re: Failed to compile JSP containing Java 7 syntax
ctomc Jul 26, 2014 6:40 AM (in response to ctomc)Anyhow, you can manually fix it in 8.0.
see my reply in this thread wildfly-8.0.0.Final w/ jdk1.8.0
-
8. Re: Failed to compile JSP containing Java 7 syntax
jessholle Jul 28, 2014 7:51 AM (in response to ctomc)Ah, yes, that fixed it. Thanks!