I am using WSO2 Identity server in my project for authentication and authorization.
Problem:
All is working fine in Tomcat (in all versions), but when it comes to Weblogic, I'm getting an issue. I'm able to deploy successfully and its running as expected, but when there is need to update the war file in Weblogic, the exception below is being thrown. In order to update successfully, either I have to stop the managed server, deploy and start the application, or I need to restart the server after updating. To restart the managed server every time seems not feasible.
Error Stacktrace (from Weblogic log):
javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:200)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:152)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:232)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderF
actory.java:120)
at org.apache.beehive.netui.pageflow.internal.annotationreader.Processed
AnnotationParser.parse(ProcessedAnnotationParser.java:61)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException:
org/apache/xerces/jaxp/DocumentBuilderFactoryImpl
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:1
24)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:188)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:152)
Truncated. see log file for complete stacktrace
>
RND what I made: (Below steps I tried individually and together)
1) Added package into weblogic.xml (org.apache.*)
2) Added xerces into pom
3) When I checked the library of the identity server, I found a dependency which creates an issue, which is the org.wso2.carbon.identity.sso.agent version 1.2.0. For this when I debug all class file, I find: System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
org.wso2.carbon.identity.sso.agent.saml.SAML2SSOManager.java (Line 719)
which is the actual reason for this issue I guess, but could not able to comment/remove it because I'm not able to build code of the identity server
4) Finally i created shared library for xerces in Weblogic. But again its creating an issue with another application as it will apply all webapp which deployed in same managed server.
I tried every possible way I know of, but no luck.
Anyone has overridden org.wso2.carbon.identity.sso.agent(1.2.0), or knowns any source of how to do it?
As per my knowledge, I guess that is the way for the solution.