Announcement Announcement Module
Collapse
No announcement yet.
Exception when loading application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception when loading application

    I have a complete Spring application...I had it working on Glassfish and now I'm trying to deploy on Websphere 6.0.

    This is the error that I'm getting.

    ClassCastException: org/springframework/web/servlet/support/JstlUtils$SpringLocalizationContext incompatible with java/lang/String

    I have looked up the SpringLocalizationContext and it looks to be a problem with my mymessages.properties file. I have searched relentlessly online and I found this and tried it to no avail.

    I added this to my web.xml
    <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContex t</param-name>
    <param-value>mymessages</param-value>
    </context-param>

    I also added /WEB-INF/ to the value in my appname-servlet.xml file.

    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename" value="/WEB-INF/mymessages"/>
    </bean>

    This also did not work.

    Does anyone have any ideas?

  • #2
    I think this solution of your's fixes only the message bundle file name. The filename 'messages.properties' is somehow "reserved" file name by WebSphere. By renaming your own message bundles e.g. 'mymessages.properties" fixes the problem.

    Check the Java versions that websphere 6 uses. Personally I don't have that much experience from WebSphere servers.

    Comment


    • #3
      Hi.
      I am using pluto-1.1.5 and tomcat-5.5.26 with jboss-el implementation.
      I want to try latest 2.0.3 SpringWebFlow Samples, booking-portlet-mvc.

      did ant clean jar, deployed war file to webapps dir.
      I can add the portlet, but when i want to render it i get:

      org.apache.jasper.JasperException: org.springframework.web.servlet.support.JstlUtils$ SpringLocalizationContext cannot be cast to java.lang.String

      Any hints what i can do - its a fresh "checkout" + fresh build, latest 1.1.5 branch of pluto - don't know where to search for, any hints?

      Comment


      • #4
        Hi Neo_0815,

        were you able to resolve the error you posted? I am getting the same error. could you please post how you resolved it?

        Thanks,

        anicad

        Comment


        • #5
          I had the same issue with Pluto current bundle distribution 1.1.6. The ClassCastException is actually from Pluto's default theme jsp. 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.

          Solution: move the jstl-1.0.6.jar and standard-1.0.6.jar under pluto-1.1.6\webapps\pluto\WEB-INF\lib into pluto-1.1.6\shared\lib

          Note: do not include these 2 jar files in your portlet application (war file).

          Comment


          • #6
            Pluto 1.1.7 with Spring Portlet Sample

            Me 2, same issue with pluto but with the latest version 1.1.7.
            Note that the default spring-portlet-sample comes with jstl.jar and standard.jar in spring-portlet-sample\WEB-INF\lib

            you will need to delete these 2 files and make sure both jstl-1.0.6.jar and standard-1.0.6.jar are in the pluto-1.1.7\shared\lib directory.

            The message that I was getting :

            java.lang.ClassCastException: javax.servlet.jsp.jstl.fmt.LocalizationContext

            Derek.

            Comment


            • #7
              Originally posted by LouTseng View Post
              I had the same issue with Pluto current bundle distribution 1.1.6. The ClassCastException is actually from Pluto's default theme jsp. 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.

              Solution: move the jstl-1.0.6.jar and standard-1.0.6.jar under pluto-1.1.6\webapps\pluto\WEB-INF\lib into pluto-1.1.6\shared\lib

              Note: do not include these 2 jar files in your portlet application (war file).



              thnx very much ... i had same problem ... the solution is perfect.

              Comment


              • #8
                exception in booking-portlet-mvc from spring-webflow-2.0.8.RELEASE

                Hi,

                After building the booking-portlet-mvc source from spring-webflow-2.0.8.RELEASE and deploying to pluto-1.1.7
                I receive the following error:

                Code:
                java.lang.IllegalStateException: Unable to create the default express
                ion parser for Spring Web Flow: Neither a Unified EL implementation or OGNL coul
                d be found.
                So I included the following to the pom.xml of the booking-portlet-mvc

                Code:
                <dependency>
                    <groupId>org.ognl</groupId>
                    <artifactId>com.springsource.org.ognl</artifactId>
                    <version>2.6.9</version>
                </dependency>
                After that I don't receive the previous exception but I got the following

                Code:
                The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
                The build for booking-portlet-mvc doesn't include in the war the jstl and standard jar files. As the previous posts suggested I have moved the jstl-1.0.6.jar and standard-1.0.6.jar from the webapps\pluto\WEB-INF\lib into the shared\lib folder.
                But still I receive the previous exception.

                Comment


                • #9
                  Hi

                  please try to change import of taglib from

                  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

                  to


                  <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>


                  If won't work then try to add dependency to

                  <dependency>
                  <groupId>javax.servlet</groupId>
                  <artifactId>jstl</artifactId>
                  <version>1.1.2</version>
                  <scope>compile</scope>
                  </dependency>
                  <dependency>
                  <groupId>taglibs</groupId>
                  <artifactId>standard</artifactId>
                  <version>1.1.2</version>
                  <scope>compile</scope>
                  </dependency>

                  Comment

                  Working...
                  X