3 Replies Latest reply on Mar 10, 2017 11:01 AM by antoine.rey

    JSTL fmt tag fails in JBoss EAP 6.2

    amarnath_rc

      The following error is thrown in Spring mvc based web application. I think this happens since Jboss core JSTL module is being loaded along with application jars.

       

       

       

      JBWEB000236: Servlet.service() for servlet controldispatcher threw exception: java.lang.ClassCastException: org.springframework.web.servlet.support.JstlUtils$SpringLocalizationContext cannot be cast to java.lang.String

        at org.apache.taglibs.standard.tag.common.fmt.BundleSupport.getLocalizationContext(BundleSupport.java:178) [jboss-jstl-api_1.2_spec-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]

        at org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport.getFormattingLocale(SetLocaleSupport.java:320) [jboss-jstl-api_1.2_spec-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]

        at org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport.doEndTag(ParseDateSupport.java:174) [jboss-jstl-api_1.2_spec-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]

        at org.apache.jsp.display.search.proposalDetailed.searchProposalBody_jsp._jspx_meth_fmt_005fparseDate_005f0(searchProposalBody_jsp.java:1403)

       

       

      I've tried to exclude jboss jstl api in Jboss-deployment-structure xml but no luck. Can someone help with appropiate deployment xml for this or any other solution appreciated?

       

       

      P.S. I think this issue is resolved in wildFly as class loading techniques are changed. But one of my customer wants to be in EAP 6.2, so I'm stuck with this error.

       

      Regards,

      Amarnath

        • 1. Re: JSTL fmt tag fails in JBoss EAP 6.2
          antoine.rey

          I've got the same issue with JBoss 6.4 EAP. Did you find any solution?

          • 2. Re: JSTL fmt tag fails in JBoss EAP 6.2
            andey

            Hi,

             

            It's trying to cast a org/springframework/web/servlet/support/JstlUtils$SpringLocalizationContext into a java/lang/String . This is due to that the JSTL implementation doesn't recognize SpringLocalizationContext as a LocalizationContext instance though SpringLocalizationContext surely implements the interface. The root cause is that two classes are loaded from different classloader thus the instanceof check failed.

             

            This appears to be a conflict due to the presence of same versions of jstl jars in the different distribution.

            Note: Do not include same jstl 2 jar files in your application (war file).

            • 3. Re: JSTL fmt tag fails in JBoss EAP 6.2
              antoine.rey

              Thanks Anup. My problem has disapeared after some maven clean install and redeployment from my IDE.