As part of our application, we use the apache xerces jaxp parser. When we deploy the application on weblogic 9.2, we get 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
According to our analysis, weblogic is trying to load its own DocumentBuilderFactoryImpl, which is present in weblogic.jar instead of aper xerces.
We tried the following to make weblogic load DocumentBuilderFactoryImplfrom xerces
i) we added the following tag to weblogic.xml
<prefer-web-inf-classes>true</prefer-web-inf-classes>
ii) we installed the latest versions of xalan in the jre / lib / endorced folder. this did not solve our problem.
ii) we added entries to weblogic-application.xml
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
<application-param>
<param-name>webapp.encoding.default</param-name>
<param-value>UTF-8</param-value>
</application-param>
<prefer-application-packages>
<package-name>javax.jws.*</package-name>
<package-name>org.apache.xerces.*</package-name>
<package-name>org.apache.xerces.jaxp.*</package-name>
</prefer-application-packages>
</weblogic-application>
ii) Added the following entry to weblogic-application.xml
<xml>
<parser-factory>
<saxparser-factory>org.apache.xerces.jaxp.SAXParserFactoryImpl</saxparser-factory>
<document-builder-factory>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</document-builder-factory>
<transformer-factory>org.apache.xalan.processor.TransformerFactoryImpl</transformer-factory>
</parser-factory>
</xml>
iii) Added jaxp.propertiesto download DocumentBuilderFactoryImplfrom xerces in jre / lib and run the server. In this case, the web logic did not start.
iv) Then we first started the server and then copied the file jaxp.propertiesduring the server startup time. But no success
None of the above worked for us.
.