aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBoss 6.1.0 - java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to jav Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss 6.1.0 - java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to jav" Watch "JBoss 6.1.0 - java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to jav" New topic
Author

JBoss 6.1.0 - java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to jav

Maciej Opala
Ranch Hand

Joined: Jul 18, 2011
Posts: 38
Hi,

When I deploy in JBoss 6.1.0 my web application packed in an ear archive I obtain the following error in logs:


I do some xml processing just after the context of application gets initialized. I guess that this error has something in common with the content of WEB-INF/lib directory of the ear which is:

I was trying removing both stax-api-1.0.1.jar and geronimo-stax-api_1.0_spec-1.0.jar but then new exception occurred:

Really no idea what to do. Any help would be greatly appreciated..
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Also remove the servlet-api.jar file, you don't need that, JBoss AS provides it. Hopefully that will fix the error.


JBoss In Action
Maciej Opala
Ranch Hand

Joined: Jul 18, 2011
Posts: 38
I've removed the following libs:

which solved the problem finally. It seems strange because same war with mentioned libs was deployed well on JBoss 4.2.3GA. Any explanation? I agree with servlet api, will also remove it.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Most likely, JBoss AS 6 is already providing that functionality found in those JARs, whereas 4.2.3 didn't.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss 6.1.0 - java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to jav