aspose file tools*
The moose likes JBoss/WildFly and the fly likes Cast problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Cast problem" Watch "Cast problem" New topic
Author

Cast problem

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
I am updated from jboss-4.0.5.GA to jboss-5.1.0.GA, been getting reams of errors an bugs allfun to work through.

Now I am getting this cast error.



com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl is contained in the xercesImpl-2.6.2.jar
and it extends javax.xml.parsers.SAXParserFactory.

Since objectA extends objectB objectA can be cast into objectB.

So although its output as a cast error, there must be another reason, any thoughts any ideas.



Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
Using jarscan to scan all my jar files I only have one jar xml-apis-1.0.b2.jar that contains javax.xml.parsers.SAXParserFactory

So its not a case of two or morejar files containing javax.xml.parsers.SAXParserFactory.
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Please remove any xerces related jar that you have added into the existing JBoss. JBoss 5.1 already contains xerces jars and you don't need to add those jars again which might be old. I had faced the same problem while upgrading from JBoss 4.2 to JBoss 5.1.
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
Thanks uttam

Found a or The solution :



Link http://www.mastertheboss.com/jboss-application-server/223-solving-jboss-5-classloading-issues.html

JBoss 5 adds the concepts of custom meta data files, one of which is jboss-classloading.xml
which let you define exactly how the war classloader is constructed.

Added jboss-classloading.xml to C:\appservers\jboss-5.1.0.GA\server\bgifunds\deploy\bgifunds.war\WEB-INF

This sorts out all the class loading problems.
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

yes, that's the way to force your own class-loading.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cast problem