版本号`0.5.3` - java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils #423

Open
hocgin opened this Issue Dec 17, 2016 · 1 comment

Projects

None yet

2 participants

@hocgin
hocgin commented Dec 17, 2016 edited

错误坐标
不应该是使用 org.apache.commons.lang3.StringUtils ?
我使用版本0.5.3时报错

Exception in thread "pool-1-thread-1" java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
	at us.codecraft.webmagic.downloader.HttpClientDownloader.getHtmlCharset(HttpClientDownloader.java:212)
	at us.codecraft.webmagic.downloader.HttpClientDownloader.getContent(HttpClientDownloader.java:194)
	at us.codecraft.webmagic.downloader.HttpClientDownloader.handleResponse(HttpClientDownloader.java:182)
	at us.codecraft.webmagic.downloader.HttpClientDownloader.download(HttpClientDownloader.java:96)
	at us.codecraft.webmagic.Spider.processRequest(Spider.java:409)
	at us.codecraft.webmagic.Spider$1.run(Spider.java:322)
	at us.codecraft.webmagic.thread.CountableThreadPool$1.run(CountableThreadPool.java:74)
	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:745)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 10 more

搜搜了issues发现有提交记录但没有处理回复? ???😧

@code4craft
Owner

#314
目前比较稳妥的方式是将jsonpath的依赖去掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment