升级公地的HttpClient HttpClient的,以与4.x.jar最新opensaml版本
问题描述:
在我的项目面临的问题,我需要更新的依赖阿帕奇公地httpclient的-3.1.jar到的HttpClient-4.5.3.jar因为commons-httpclient.jar正在进入EOL。升级公地的HttpClient HttpClient的,以与4.x.jar最新opensaml版本
我面对这里的问题是opensaml-2.6.6.jar有openws-1.5.6.jar和的依赖是有公地httpclient的-3.1.jar的依赖。
Maven仓库说,我们可以更新到HttpClient的-4.5.3.jar,但是当我使用OpenSaml设置我得到以下
Error ::
/*
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/protocol/ProtocolSocketFactory
at org.springframework.security.saml.SAMLBootstrap.postProcessBeanFactory(SAMLBootstrap.java:42)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:281)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:176)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.protocol.ProtocolSocketFactory
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
异常请让我知道需要做什么。
答
我认为OpenSaml v2不会被新的依赖项更新,因为v3已经发布并且旧版本不支持。 official v3
根据maven的说法,我发现openws-1.5.6.jar用于SOAP,而OpenSaml的v3版本将它分开为OpenSAML:: SOAP Provider API和this version (3.3.0) depends on httpclient 4.3.6。
所以我想也许你需要考虑升级OpenSaml V3,它具有几乎相同的功能(只需稍微改变引导方法)