aspose file tools*
The moose likes Struts and the fly likes ClassCastException when starting Tomcat with Struts2 Filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ClassCastException when starting Tomcat with Struts2 Filter" Watch "ClassCastException when starting Tomcat with Struts2 Filter" New topic
Author

ClassCastException when starting Tomcat with Struts2 Filter

Kurt Kopf
Greenhorn

Joined: Jun 28, 2010
Posts: 9
OS: Windows 7
Tomcat: 6.0.26
Struts 2.1.8.1
Java 1.6.0_20

Whenever I try and start up my app in Tomcat with a struts filter, I get the following exception:

I actually had the same exception on my OS X box, but that was with Tomcat 6.0.24. When I upgraded to .26, everything worked fine. I'm using the same exact code base, libraries, etc, on the two machines but with no luck. Using the same major and minor Java versions as well, both compiled for 64-bit. I've tried going back to Tomcat .24 and .20 with no luck. I haven't tried going to Struts 2.0.x, but I'll probably try it out if no one has any suggestions.

Thanks in advance for your help, hopefully it's just something simple.
Alpesh Padra
Ranch Hand

Joined: Jan 10, 2010
Posts: 41
Please verify your filter entries in web.xml since its comming while application loading.
Kurt Kopf
Greenhorn

Joined: Jun 28, 2010
Posts: 9
Here's my web.xml:


Thanks for any insight =)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What libraries are you deploying with your application?
Kurt Kopf
Greenhorn

Joined: Jun 28, 2010
Posts: 9
I figured out the issue. In OS X, Eclipse Galileo is 64-bit. In Win23, Galileo is only 32 bit. I had to upgrade Eclipse to Helios 64-bit (which means none of my SVN stuff works, but that's a completely different issue).

Thanks David, you actually sent me down the path that solved the issue.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Glad you figured it out :) Yeah, most times when a totally bizarre issue like that pops up it's some form of library mismatch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassCastException when starting Tomcat with Struts2 Filter
 
Similar Threads
Filters initialized before context is ready
struts2-maven File not found exception problem
Trying to add string values to a list or some type of collection through iterator
Missing CharacterEncodingFilter, UrlRewriteFilter?
rich:tree working now... all the work has finally paid off - THANKS