Bug 1305033 - Unable to complie jsp which contains lambda which uses implicit variables of jsp
Unable to complie jsp which contains lambda which uses implicit variables of jsp
Status: CLOSED NOTABUG
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web (Show other bugs)
6.4.5
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: jboss-set
Radim Hatlapatka
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-05 06:56 EST by Radim Hatlapatka
Modified: 2016-07-13 12:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-10 04:01:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEAP-3261 Blocker Closed Unable to complie jsp which contains lambda which uses implicit variables of jsp 2016-07-13 12:37 EDT

  None (edit)
Description Radim Hatlapatka 2016-02-05 06:56:24 EST
Having jsp, which uses implicit jsp variable, such as {{out}} in lambda expression \[1\] fails to compile, see \[2\]. Using instead of lambda's forEach standard for cycle works without issues.

[1]
test.jsp using lambda with implicit variable
{code}
<%@ page language="java" pageEncoding="UTF-8" contentType="text/plain;charset=utf-8"%>
<%
String[] names = {"Joe", "Doe", "John", "Peter"};
java.util.List<String> namesAsList = java.util.Arrays.asList(names);
namesAsList.forEach(out::println);

for (String name : namesAsList) {
	out.println(name);
}
%>
{code}

[2]
{noformat}
JBWEB004060: An error occurred at line: 5 in the jsp file: /jsp-with-lambdas-implicit-variables.jsp
Unhandled exception type IOException
2: <%
3: String[] names = {"Joe", "Doe", "John", "Peter"};
4: java.util.List<String> namesAsList = java.util.Arrays.asList(names);
5: namesAsList.forEach(out::println);


Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:95)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:449)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:359)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:652)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
	at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
{noformat}
Comment 1 JBoss JIRA Server 2016-02-10 04:00:04 EST
Radim Hatlapatka <rhatlapa@redhat.com> updated the status of jira JBEAP-3261 to Closed
Comment 2 Radim Hatlapatka 2016-02-10 04:01:51 EST
This is actually not a bug in EAP. It is caused by Java not allowing to throw checked exceptions from lambda expressions.
Comment 3 JBoss JIRA Server 2016-02-23 09:34:12 EST
Carlo de Wolf <cdewolf@redhat.com> updated the status of jira JBEAP-3261 to Reopened
Comment 4 JBoss JIRA Server 2016-02-25 06:11:56 EST
Radim Hatlapatka <rhatlapa@redhat.com> updated the status of jira JBEAP-3261 to Closed
Comment 5 JBoss JIRA Server 2016-02-25 06:26:39 EST
Carlo de Wolf <cdewolf@redhat.com> updated the status of jira JBEAP-3261 to Reopened
Comment 6 JBoss JIRA Server 2016-02-25 06:27:10 EST
Carlo de Wolf <cdewolf@redhat.com> updated the status of jira JBEAP-3261 to Resolved
Comment 7 JBoss JIRA Server 2016-07-13 12:37:01 EDT
Jiri Pallich <jpallich@redhat.com> updated the status of jira JBEAP-3261 to Closed

Note You need to log in before you can comment on or make changes to this bug.