I am working on jsp application with weblogic8.1 server and when I am trying to invoke javax.xml.parsers.DocumentBuilderFactory.newInstance() method I get a ClassCastException. I didn't get this exception when I run this class on my work station (not on server). The DocumentBuilderFactory is an abstract class and it uses an implementing class -DocumentBuilderFactoryImpl to actually create the instance. I figured out that wls8 has 2 DIFFERENT such implementing classes in different packages: 1 - crimson impl. in install_dir/JDK/jre/lib/rt.jar 2 - xerces impl. in install_dir/weblogic/server/lib/weblogic.jar So, I assume that the jdk excpects a certain impl. class type and gets the other and therefore throws a ClassCastException. If this is the diagnoze, how can it be fixed/avoided? thanks
Hi The weblogic documentation is located over here http://edocs.bea.com/wls/docs81/xml/index.html This document states that Weblogic 8.1 packages both the Apache Xerces parser and the JAXP parser. Apache Xerces parser version 2.1.0 is the default parser and it is recommended one use the interfaces provided by JAXP. You need to look at what parser you would like to use and configure and use that parser. I think that you have configured the parser wrongly. Check up the weblogic.log for error messages and see if u can post them here.