An application I maintain uses a third-party commercial EJB implementation. I do not have the ability to change the source code, but I can read it.
I have determined that the source code of the EJB is setting a specific implementation of javax.xml.parsers.DocumentBuilderFactory
using:
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
I would like to prevent this -- but from a WAR file.
My EAR is:
EAR application.xml weblogic-application.xml 3rd-party-ejb.jar my-web-app.war
There is the Detecting System.setProperty method invocations question about implementing a custom java.lang.SecurityManager which I am looking into now, but I don't still understand how the WAR file can influence the 3rd-party-ejb.jar behavior.
What's the proper solution?