This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Cast problem
 
Similar Threads
Jboss class cast exception: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
inscrutable differences
Finding an object reference
axis2. xsi:type object mapping does not work
Starting JBoss