java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory

▼魔方 西西 提交于 2020-06-01 08:05:51

问题


I have installed my application and restarted in WAS 8.5, I see below exception in SystemOut.log,where as it works fine in WAS 7.

java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory.<init>(Ljava/lang/String;Ljava/security/KeyStore;Ljava/lang/String;Ljava/security/KeyStore;Ljava/security/SecureRandom;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V

Can any one help me how to resolve this issue?


回答1:


I'd guess you're deploying and trying to use one version of Apache HttpClient, but that WebSphere has a different version included in its libraries. If you could use the WebSphere-included version, that would be simplest, but if you need to use the specific version, you could change the WebSphere classloader policy to PARENT_LAST.




回答2:


websphere8 /WebSphere/AppServer/plugins/com.ibm.ws.prereq.jaxrs.jar has packages org.http.* com.ibm.ws.prereq.jaxrs.jar and HttpClient.jar conflict!

Change classloaders order invalid because com.ibm.ws.prereq.jaxrs.jar has been loaded when websphere start!

you can change HttpClient packages from org.http.* to net.test.* to avoid conflict

ps: http://www.ibm.com/developerworks/cn/websphere/library/techarticles/1108_jiangwk_classloader/1108_jiangwk_classloader.html



来源:https://stackoverflow.com/questions/13604272/java-lang-nosuchmethoderror-org-apache-http-conn-ssl-sslsocketfactory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!