Java.lang.RuntimeException: Cannot create a secure XMLInputFactory [How to Solve]

The client calls the server CXF, and the server reports java.lang.runtimeexception: cannot create a secure xmlinputfactory

My CXF version is 3.0.0

Woodstox core ASL Version is 4.4.0

The server is Weblogic

The reason for the exception is that Weblogic’s own jar conflicts with woodstox jar

The solution is to increase the configuration of weblogic.xml under webapp/WEB-INF/and give priority to loading our own jars

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
    <container-descriptor>
        <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
        <prefer-web-inf-classes>false</prefer-web-inf-classes>
        <prefer-application-packages>
            <package-name>com.ctc.wstx.*</package-name>
        </prefer-application-packages>
    </container-descriptor>
</weblogic-web-app>

Similar Posts: