2 Replies Latest reply on Apr 27, 2010 10:40 AM by Richard Morey

    Issue with Code on JBoss 5 that worked on JBoss 4

    Richard Morey Newbie

      Hi --

      I have written a Java application that retrieves session info using this  line of code:

      HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();

      This works fine in our deployment of JBoss 4.2.3. However, after  installing JBoss 5.1 and running the application I get this error on  that line of code:

      java.lang.ClassCastException:  org.apache.catalina.connector.RequestFacade cannot be cast to  javax.servlet.http.HttpServletRequest

      I have searched high and low on Google for an answer to this problem but  have not yet found a solution that works. One thing I did try was to  replace the servlet-api.jar contained in JBoss 5 with an older version  from JBoss 4.2.3 but this didn't work.

      Any help would be greatly appreciated!