Bug 1075353 - [GSS] (6.4.0) ClassCastException in JSPs where spring-web tags and jstl tags are used
Summary: [GSS] (6.4.0) ClassCastException in JSPs where spring-web tags and jstl tags ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EE
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER1
: EAP 6.4.0
Assignee: baranowb
QA Contact: Pavel Slavicek
URL:
Whiteboard:
Depends On: 1122786
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-12 04:23 UTC by abhishek vijra
Modified: 2019-08-02 07:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-02 07:30:34 UTC
Type: Bug


Attachments (Terms of Use)
bug reproducer (2.44 MB, application/x-java-webarchive)
2014-03-12 04:23 UTC, abhishek vijra
no flags Details


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEE-154 Major Resolved ClassCastException in JSPs where spring-web tags and jstl tags are used 2016-08-02 14:46:55 UTC
JBoss Issue Tracker WFLY-3100 Major Resolved ClassCastException in JSPs where spring-web tags and jstl tags are used 2016-08-02 14:46:55 UTC

Description abhishek vijra 2014-03-12 04:23:13 UTC
Created attachment 873315 [details]
bug reproducer

Following JSP with spring tags

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<html>
<head><title>Simple jsp page</title></head>
<body>

<c:set var="hasError" value="$
{param.hasError}

" />
<c:set var="msg" value="$
{param.msg}" />

<c:if test="${param.hasError=='true'}">
Message: <spring:message text="${param.msg}

"/>
</c:if>

</body>
</html>
breaks following error
ERROR [org.springframework.web.servlet.tags.MessageTag] (default task-1) org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects: java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects
at javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects.getImplicitObjects(ImplicitObjectELResolver.java:608) [jboss-jsp-api_2.3_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.jsp.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:169) [jboss-jsp-api_2.3_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:95) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:32) [jastow-1.0.0.Final.jar:1.0.0.Final]
at org.apache.jasper.el.ELResolverImpl.getValue(ELResolverImpl.java:78) [jastow-1.0.0.Final.jar:1.0.0.Final]
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116) [javax.el-3.0.0.jar:3.0.0]
at com.sun.el.parser.AstValue.getBase(AstValue.java:151) [javax.el-3.0.0.jar:3.0.0]
at com.sun.el.parser.AstValue.getValue(AstValue.java:200) [javax.el-3.0.0.jar:3.0.0]

There are two jars (jboss-jsp-api_2.3_spec-1.0.0.Final.jar and jboss-jstl-api_1.2_spec-1.0.4.Final.jar) that are incompatible with each other due to a bug – both are storing an object in the same place, but the objects are not compatible.

The result is that a jsp page cannot contain both JSTL and Spring tags, or it will get that error.

Comment 1 JBoss JIRA Server 2014-03-27 21:16:42 UTC
Tomaz Cerar <tomaz.cerar@gmail.com> updated the status of jira WFLY-3100 to Resolved

Comment 6 JBoss JIRA Server 2014-07-23 12:49:29 UTC
Tomaz Cerar <tomaz.cerar@gmail.com> updated the status of jira JBEE-154 to Resolved

Comment 7 Tomaz Cerar 2014-07-23 14:00:18 UTC
Release is done, so this can be included in 6.4 once branch is open for merging.

Comment 10 Radim Hatlapatka 2014-12-15 13:03:35 UTC
Failed with EAP 6.4.0.DR13.

I used the attached reproducer and go to http://localhost:8080/spring-fun/a.jsp?hasError=true and the issue is still there.

Comment 11 Radim Hatlapatka 2014-12-15 13:05:30 UTC
The exception I see in logs is:

:57:59,293 ERROR [org.springframework.web.servlet.tags.MessageTag] (http-/127.0.0.1:8080-1) org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects: java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects
	at javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects.getImplicitObjects(ImplicitObjectELResolver.java:608) [jboss-jsp-api_2.2_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]
	at javax.servlet.jsp.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:169) [jboss-jsp-api_2.2_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]
	at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:86) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:32) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.ELResolverImpl.getValue(ELResolverImpl.java:71) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.el.parser.AstValue.getValue(AstValue.java:144) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.ExpressionImpl.evaluate(ExpressionImpl.java:35) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:55) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.springframework.web.util.ExpressionEvaluationUtils$Jsp20ExpressionEvaluationHelper.evaluate(ExpressionEvaluationUtils.java:398) [spring.jar:2.0.2]
	at org.springframework.web.util.ExpressionEvaluationUtils.doEvaluate(ExpressionEvaluationUtils.java:270) [spring.jar:2.0.2]
	at org.springframework.web.util.ExpressionEvaluationUtils.evaluateString(ExpressionEvaluationUtils.java:186) [spring.jar:2.0.2]
	at org.springframework.web.servlet.tags.MessageTag.resolveMessage(MessageTag.java:215) [spring.jar:2.0.2]
	at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:165) [spring.jar:2.0.2]
	at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77) [spring.jar:2.0.2]
	at org.apache.jsp.a_jsp._jspx_meth_spring_005fmessage_005f0(a_jsp.java:189)
	at org.apache.jsp.a_jsp._jspx_meth_c_005fif_005f0(a_jsp.java:159)
	at org.apache.jsp.a_jsp._jspService(a_jsp.java:84)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-15.jar:7.5.0.Final-redhat-15]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]

13:57:59,302 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/spring-fun].[jsp]] (http-/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet jsp threw exception: java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects
	at javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects.getImplicitObjects(ImplicitObjectELResolver.java:608) [jboss-jsp-api_2.2_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]
	at javax.servlet.jsp.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:169) [jboss-jsp-api_2.2_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]
	at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:86) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:32) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.ELResolverImpl.getValue(ELResolverImpl.java:71) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.el.parser.AstValue.getValue(AstValue.java:144) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.ExpressionImpl.evaluate(ExpressionImpl.java:35) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:55) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.springframework.web.util.ExpressionEvaluationUtils$Jsp20ExpressionEvaluationHelper.evaluate(ExpressionEvaluationUtils.java:398) [spring.jar:2.0.2]
	at org.springframework.web.util.ExpressionEvaluationUtils.doEvaluate(ExpressionEvaluationUtils.java:270) [spring.jar:2.0.2]
	at org.springframework.web.util.ExpressionEvaluationUtils.evaluateString(ExpressionEvaluationUtils.java:186) [spring.jar:2.0.2]
	at org.springframework.web.servlet.tags.MessageTag.resolveMessage(MessageTag.java:215) [spring.jar:2.0.2]
	at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:165) [spring.jar:2.0.2]
	at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77) [spring.jar:2.0.2]
	at org.apache.jsp.a_jsp._jspx_meth_spring_005fmessage_005f0(a_jsp.java:189)
	at org.apache.jsp.a_jsp._jspx_meth_c_005fif_005f0(a_jsp.java:159)
	at org.apache.jsp.a_jsp._jspService(a_jsp.java:84)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-15.jar:7.5.0.Final-redhat-15]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.3.Final.jar:7.5.3.Final]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]

Comment 12 Tomaz Cerar 2014-12-15 13:26:14 UTC
Fix is in jboss-jsp-api_2.2_spec-1.0.2.Final but stack trace tells us that it is using jboss-jsp-api_2.2_spec-1.0.1.Final.

looks like new version never got to EAP.

Comment 13 James Livingston 2014-12-16 02:18:11 UTC
The upgrade bug is 1122786, which is still NEW.

Comment 15 Radim Hatlapatka 2015-01-13 14:19:22 UTC
Verified in EAP 6.4.0.ER1


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