Atitit 类库冲突解决方案 httpclient-4.5.2.jar
来源:互联网 发布:衣服好看又好的淘宝店 编辑:程序博客网 时间:2024/05/18 00:36
Atitit 类库冲突解决方案 httpclient-4.5.2.jar
错误提示如下1
版本如下(client and selenium)2
解决流程2
挂载源码 (SSLConnectionSocketFactory.java:1442
原因:SSLConnectionSocketFactory调取AllowAllHostnameVerifier 的时候,调取了另外一个jar里面的allowAhnVer这个class3
解决:把4.5jar放在前面运行,让它先加载。。或者使用代码预先加载4.5jar包里面的jar。。3
错误提示如下
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:65)
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:55)
at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:234)
at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.<init>(ApacheHttpClient.java:211)
at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:88)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:57)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:93)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
at com.attilax.net.httpTest.main(httpTest.java:18)
版本如下(client and selenium)
(SSLConnectionSocketFactory.java:144) httpclient-4.5.2.jar
selenium
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
解决流程
挂载源码 (SSLConnectionSocketFactory.java:144
@Deprecated
public static final X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER
= AllowAllHostnameVerifier.INSTANCE;
Org.apache.http.conn.ssl。AllowAllHostnameVerifier
public class AllowAllHostnameVerifier extends AbstractVerifier {
public static final AllowAllHostnameVerifier INSTANCE =new AllowAllHostnameVerifier();
这个AllowAllHostnameVerifier 就在client4.5.2 jar里面啊,也有这个INSTANCE 属性的。。
我猜想可能,SSLConnectionSocketFactory调取AllowAllHostnameVerifier 的时候,调取了另外一个jar里面的allowAhnVer这个class
使用jar包搜索工具,果然搜索到client4.1这个jar。。
原因:SSLConnectionSocketFactory调取AllowAllHostnameVerifier 的时候,调取了另外一个jar里面的allowAhnVer这个class
解决:把4.5jar放在前面运行,让它先加载。。或者使用代码预先加载4.5jar包里面的jar。。
删除4.1d jar也可,但是可能有兼容性问题,最好还是调整jar加载优先级在bat和 .claspath文件里面。。
作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )
汉字名:艾提拉(艾龙), EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
Atiend
- Atitit 类库冲突解决方案 httpclient-4.5.2.jar
- Atitit 类库冲突 解决方案
- Maven Jar冲突解决方案
- SSH jar冲突问题 解决方案
- Maven jar包冲突解决方案
- slf4j jar包冲突解决方案
- java jar包冲突解决方案
- maven JAR包冲突解决方案
- Maven依赖冲突之httpclient.jar包冲突异常分析
- websphere中jar包冲突解决方案--共享库
- Atitit.java jar hell解决方案-----Djava.ext.dirs in ide envi..
- eclipse中使用maven库添加jar包时,出现jar包冲突的解决方案
- jar文件版本冲突的最佳解决方案
- android-support-v4.jar文件冲突解决方案
- Android Studio Jar包冲突解决方案
- AS中jar包冲突解决方案
- was环境jar包冲突解决方案
- face++的开发包faceppsdk.jar 和httpclient.jar 冲突解决
- mysql中count(1)与count(*)比较
- qqzoneQQ空间漏洞扫描器的设计attilax总结
- CODEVS 1295N皇后问题
- 第一个offer-深信服&面试经验
- NOIP之前的计划?
- Atitit 类库冲突解决方案 httpclient-4.5.2.jar
- 图论 二分图 hdu1533 KM最大匹配
- java字符串反转的7种方式
- 逻辑运算符
- 【前端第三天】闭包的含义,闭包的优缺点,闭包的使用场景
- docker筑基篇-04-使用Dockerfile构建自己的镜像
- linux文件锁详解(设计文件很底层的操作)
- HDU 1577 WisKey的眼神 (GCD求直线上的点数)
- android 调用 screenrecord 实现录屏