Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
at us.codecraft.webmagic.downloader.HttpClientGenerator.<init>(HttpClientGenerator.java:38)
at us.codecraft.webmagic.downloader.HttpClientDownloader.<init>(HttpClientDownloader.java:52)
at us.codecraft.webmagic.Spider.initComponent(Spider.java:280)
at us.codecraft.webmagic.Spider.run(Spider.java:305)
at pachong.Getgov.main(Getgov.java:31)
原因:
对java项目构建路径发现有httpclient包和httpcore包都有两个,可能导致冲突。(具体原因没有了解)
解决:
删除版本低的httpclient包和httpcore包