java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl while starting the w
Posted
by venkat
on Stack Overflow
See other posts from Stack Overflow
or by venkat
Published on 2010-03-15T06:38:13Z
Indexed on
2010/03/15
6:39 UTC
Read the original article
Hit count: 1070
weblogic9.x
|classcastexception
Hi,
As part of our application we are using apache's xerces jaxp parser. When we deploy the application on weblogic9.2, we are getting the following error.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
As per our analysis, i)The weblogic is trying to to load its own DocumentBuilderFactoryImpl which is present in weblogic.jar instead of apache's xerces.
We tried the following to force the weblogic to load DocumentBuilderFactoryImpl from xerces i)we have added the following tag into weblogic.xml true
ii)we have put latest versions of xalan in jre/lib/endorced folder. this didnt resolve our problem.
ii) we have added entries in weblogic-application.xml
webapp.encoding.default UTF-8 javax.jws. org.apache.xerces. org.apache.xerces.jaxp.*
ii)Added the following entry in weblogic-application.xml
<parser-factory>
<saxparser-factory>org.apache.xerces.jaxp.SAXParserFactoryImpl</saxparser-factory>
<document-builder-factory>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl </document-builder-factory>
org.apache.xalan.processor.TransformerFactoryImpl
iii)Added jaxp.properties to load DocumentBuilderFactoryImpl from xerces to the jre/lib and started the server.In this case, the weblogic didnt start. iv)Then we started the server first and then copied the jaxp.properties file during the run time when server starts.But no success
None of the above worked for us.
Any help is highly appreciated.
Thanks in advance, Venkat.
© Stack Overflow or respective owner