gpt4 book ai didi

java.lang.NoSuchMethodError : org/apache/http/conn/scheme/Scheme. (Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V

转载 作者:行者123 更新时间:2023-12-02 02:14:53 26 4
gpt4 key购买 nike

我尝试使用 HttpComponentsMessageSender 在 Spring WebServiceTemplate 中设置 ConnectionTimeoutReadTimeout。但是,我收到 SchemeSocketFactory 类的 NoSuchMethodError 错误。

<bean
class="org.springframework.ws.transport.http.HttpComponentsMessageSender"
id="timeoutId">
<property name="connectionTimeout" value="3000" />
<property name="readTimeout" value="3000" />
</bean>
<小时/>
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.transport.http.HttpComponentsMessageSender]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org/apache/http/conn/scheme/Scheme.<init>(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1147)
... 65 more
Caused by: java.lang.NoSuchMethodError: org/apache/http/conn/scheme/Scheme.<init>(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
at org.apache.http.impl.conn.SchemeRegistryFactory.createDefault(SchemeRegistryFactory.java:51)
at org.apache.http.impl.conn.PoolingClientConnectionManager.<init>(PoolingClientConnectionManager.java:96)
at org.springframework.ws.transport.http.HttpComponentsMessageSender.<init>(HttpComponentsMessageSender.java:77)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:539)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
... 67 more

最佳答案

我认为修复包升级可以为您解决这个问题。 WebSphere 有一个 Apache HTTP 客户端的内部副本(由其 JAX-RS 实现使用),在修复包 8.5.5.9 之前,该副本对于已安装的应用程序是可见的。如果您想在此之前在修复包上使用您自己的副本,则需要利用 PARENT_LAST 类加载器委托(delegate)或隔离的共享库,以确保类加载器加载您自己的 Apache HTTP 副本而不是 WebSphere 的副本。

关于java.lang.NoSuchMethodError : org/apache/http/conn/scheme/Scheme. <init>(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49440892/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com