在我们的应用程序中,我们正在尝试升级到 Spring boot 2,我们正在使用 spring-security-saml2-core:1.0.4.RELEASE,在运行应用程序时我们遇到了以下异常。看来,classpaath 上有两个 jars xmltooling-1.4.6和opensaml-core-3.3.0,它们有相同的文件default-config.xml
。在这种情况下,类加载器碰巧将opensaml-core-3.3.0放在xmltooling-1.4.6.jar 之前,并且default-config.xml
加载错误
<ObjectProviders>
<ObjectProvider qualifiedName="xt:DEFAULT">
<BuilderClass className="org.opensaml.core.xml.schema.impl.XSAnyBuilder"/>
<MarshallingClass className="org.opensaml.core.xml.schema.impl.XSAnyMarshaller"/>
<UnmarshallingClass className="org.opensaml.core.xml.schema.impl.XSAnyUnmarshaller"/>
</ObjectProvider> </ObjectProviders>
java.lang.ClassCastException: org.opensaml.core.xml.schema.impl.XSAnyBuilder cannot be cast to org.opensaml.xml.XMLObjectBuilder
at org.opensaml.xml.XMLConfigurator.initializeObjectProviders(XMLConfigurator.java:236)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:182)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:166)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:143)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:203)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:186)
at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:92)
at org.opensaml.PaosBootstrap.bootstrap(PaosBootstrap.java:27)
at org.springframework.security.saml.SAMLBootstrap.postProcessBeanFactory(SAMLBootstrap.java:42).
有人可以在这里帮忙。请..