java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects at org.apache.commons.el.ImplicitObjects.getImplicitObjects(ImplicitObjects.java:123) at org.apache.commons.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:110) at org.apache.jasper.runtime.PageContextImpl.resolveVariable(PageContextImpl.java:854)

Apache's JIRA Issue Tracker | Francois Plouffe | 1 decade ago
  1. 0

    Runing Tomcat 5.0.14 and 5.0.25. Using Apache standard.jar taglibs. I am writing a custom tag that accept el expression in attributes. My tag class is using pageContext.getExpressionEvaluator.evaluate to evaluate el expressions. In a jsp page, when using only my custom tag like this: <mytag:setLocale value="${cookie.Language.value}"/>, it work fine and evaluate to the correct cookie value. But when I am using any tag from standard.jar, problem occurs. For example, when inserting <c:out value="${cookie.Language.value"}/> before mytag:setLocale, pageContext.getExpressionEvaluator.evaluate throws a ClassCastException. When c:out is inserted after mytag:setLocale, the ClassCastException is thrown from standard.jar. I have found the potential cause: when mytag:setLocale is called first, pageContext.getExpressionEvaluator.evaluate appens to add in the pageContext attributes hashMap an object of type org.apache.commons.el.ImplicitObjects with key "org.apache.taglibs.standard.ImplicitObjects". Then when c:out is called next, it retreive the from the pageContext the key "org.apache.taglibs.standard.ImplicitObjects", wich is not of type org.apache.taglibs.standard.lang.jstl.ImplicitObjects. The reverse appens when c:out is called first; an object with the key "org.apache.taglibs.standard.ImplicitObjects" of type org.apache.taglibs.standard.lang.jstl.ImplicitObjects is added in the pageContext attributes hashMap. And when mytag:setLocale is called, org.apache.commons.el.ImplicitObjects.getImplicitObjects throws a ClassCastException when pContext.getAttribute returns with an object of type org.apache.taglibs.standard.lang.jstl.ImplicitObjects. The source of the problem is that both package insert or retreive from the pagecontext attributes hashMap the same key name ("org.apache.taglibs.standard.ImplicitObjects"), but with different type. Base on the key name, I guess standard.jar is correct in using it, but commons- el.jar is not. I tested a modified commons-el.jar with member sAttributeName from org.apache.commons.el.ImplicitObjects setted to, well, "org.apache.commons.el.ImplicitObjects". It worked just fine both cases. The problem would only occurs if el evaluator from both package are called in the same jsp page with jsp's implicit objects. I dosen't have to be the same implicit object. Since I can't beleive I am the first one with this problem, I first tried find something wrong in my setup/code. But it seems not.

    Apache's JIRA Issue Tracker | 1 decade ago | Francois Plouffe
    java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects at org.apache.commons.el.ImplicitObjects.getImplicitObjects(ImplicitObjects.java:123) at org.apache.commons.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:110) at org.apache.jasper.runtime.PageContextImpl.resolveVariable(PageContextImpl.java:854)
  2. 0

    Re: [jetty-users] org.apache.jasper.JasperException: java.lang.ClassCast

    eclipse.org | 1 year ago
    java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl >>> cannot >>> be cast to org.apache.jasper.runtime.ELContextImpl at >>> >>> >>> org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1009) at >>> >>> >>> org.apache.jsp.views.error_jsp._jspService(org.apache.jsp.views.error_jsp:52)
  3. 0

    using EJB to connect to LDAP with weblogic5.1

    Coderanch | 1 decade ago | ron ray chaudhuri
    java.lang.ClassCastException: com.eds.eoi.tools.ejb.movemos.MoveMosBeanHomeImpl ServiceStub at com.eds.eoi.tools.client.ClientMos.makeConnection(ClientMos.java:123
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hello, I have an existing application usign spring version 1.2.6 deployed and perfectly working on on Sun server 8.1. When I am trying to deploy the same applciation on Sunserver 9.1, I am getting the below exception: sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-0;|ERROR [BindTag.doStartTag 75] org.apache.taglibs.standard.lang.jstl.ImplicitObjects java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects at javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects.getImplicitObjects(ImplicitObjectELResolver.java:592) at javax.servlet.jsp.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:153) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143) at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:86) at com.sun.el.parser.AstMinus.getValue(AstMinus.java:55) at com.sun.el.parser.AstPlus.getValue(AstPlus.java:55) at com.sun.el.parser.AstDynamicExpression.getValue(AstDynamicExpression.java:59) at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:64) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206) at org.apache.jasper.runtime.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:121) at org.springframework.web.util.ExpressionEvaluationUtils$Jsp20ExpressionEvaluationHelper.evaluate(ExpressionEvaluationUtils.java:216) Can anyone throw any idea to solve this?

    Spring JIRA | 8 years ago | Jwala Kompalli
    java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects
  6. 0

    Hello, I have an existing application usign spring version 1.2.6 deployed and perfectly working on on Sun server 8.1. When I am trying to deploy the same applciation on Sunserver 9.1, I am getting the below exception: sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-0;|ERROR [BindTag.doStartTag 75] org.apache.taglibs.standard.lang.jstl.ImplicitObjects java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects at javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects.getImplicitObjects(ImplicitObjectELResolver.java:592) at javax.servlet.jsp.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:153) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143) at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:86) at com.sun.el.parser.AstMinus.getValue(AstMinus.java:55) at com.sun.el.parser.AstPlus.getValue(AstPlus.java:55) at com.sun.el.parser.AstDynamicExpression.getValue(AstDynamicExpression.java:59) at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:64) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206) at org.apache.jasper.runtime.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:121) at org.springframework.web.util.ExpressionEvaluationUtils$Jsp20ExpressionEvaluationHelper.evaluate(ExpressionEvaluationUtils.java:216) Can anyone throw any idea to solve this?

    Spring JIRA | 8 years ago | Jwala Kompalli
    java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.apache.taglibs.standard.lang.jstl.ImplicitObjects at org.apache.commons.el.ImplicitObjects.getImplicitObjects(ImplicitObjects.java:123) at org.apache.commons.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:110) at org.apache.jasper.runtime.PageContextImpl.resolveVariable(PageContextImpl.java:854)

      at org.apache.commons.el.NamedValue.evaluate()
    2. EL
      ComplexValue.evaluate
      1. org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
      2. org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140)
      2 frames