This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes ClassCastException when using NTLM Authentication with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ClassCastException when using NTLM Authentication with struts" Watch "ClassCastException when using NTLM Authentication with struts" New topic
Author

ClassCastException when using NTLM Authentication with struts

Alex Philippi
Greenhorn

Joined: Oct 05, 2007
Posts: 13
Hi,
our web app uses the NTLM Authentication for SSO. This NTLM filter called for every action the user made. For legacy support the user could use some old struts actions.

Everthing is ok but when the user click on an struts action we get this weird exception:

java.lang.ClassCastException: our.company.name.NtlmHttpServletRequest cannot be cast to javax.servlet.ServletRequestWrapper
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.dhc.dhcvision.server.servlet.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:75)
com.dhc.dhcvision.server.servlet.filter.CacheAndResponseFilter.doFilter(CacheAndResponseFilter.java:108)
com.dhc.dhcvision.server.servlet.filter.SSOFilter.handleSSOLogin(SSOFilter.java:223)
com.dhc.dhcvision.server.servlet.filter.SSOFilter.doFilter(SSOFilter.java:144)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



The NtlmHttpServletRequest:


I dont get it... Normally there could not be a ClassCastException. Any ideas?

We use struts-version 1.2.8 and JBOSS 4.0.5

Best regards
Alex
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ClassCastException when using NTLM Authentication with struts