Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issue with Code on JBoss 5 that worked on JBoss 4

807580Apr 26 2010 — edited Apr 26 2010
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!

Thanks

Rich
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2010
Added on Apr 26 2010
4 comments
681 views