Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eclipse构建项目,使用模板抓取时报错 #31

Closed
llh6054 opened this issue May 16, 2018 · 2 comments
Closed

eclipse构建项目,使用模板抓取时报错 #31

llh6054 opened this issue May 16, 2018 · 2 comments

Comments

@llh6054
Copy link

llh6054 commented May 16, 2018

你好,我直接将你的打好的war包放置到Tomcat下跑然后使用你构建好的模板抓取时没问题的。
但是我在使用eclipse构建的时候,项目成功跑起来了,其他功能没问题。
同样使用你构建好的模板抓取报错

23:36:48[WARN com.gs.spider.gather.commons.ContentLengthLimitHttpClientDownloader] download page http://news.qq.com/a/20160418/023093.htm error
javax.net.ssl.SSLKeyException: RSA premaster secret error
	at sun.security.ssl.RSAClientKeyExchange.<init>(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.ClientHandshaker.serverHelloDone(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.Handshaker.processLoop(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.Handshaker.process_record(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) ~[?:1.8.0_161]
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) ~[?:1.8.0_161]
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) ~[httpclient-4.5.2.jar:4.5.2]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107) ~[httpclient-4.5.2.jar:4.5.2]
	at com.gs.spider.gather.commons.ContentLengthLimitHttpClientDownloader.download(ContentLengthLimitHttpClientDownloader.java:112) [classes/:?]
	at us.codecraft.webmagic.Spider.processRequest(Spider.java:404) [webmagic-core-0.6.0.jar:?]
	at us.codecraft.webmagic.Spider$1.run(Spider.java:321) [webmagic-core-0.6.0.jar:?]
	at us.codecraft.webmagic.thread.CountableThreadPool$1.run(CountableThreadPool.java:74) [webmagic-core-0.6.0.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_161]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_161]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_161]
Caused by: java.security.NoSuchAlgorithmException: SunTls12RsaPremasterSecret KeyGenerator not available
	at javax.crypto.KeyGenerator.<init>(KeyGenerator.java:169) ~[?:1.8.0_171]
	at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223) ~[?:1.8.0_171]
	at sun.security.ssl.JsseJce.getKeyGenerator(Unknown Source) ~[?:1.8.0_161]
	... 28 more

请问可能是什么问题呢,jdk1.8,tomcat8.5

@gsh199449
Copy link
Owner

这不是项目本身的BUG,可能是你环境配置有问题。我google了一下,供你参考

@llh6054
Copy link
Author

llh6054 commented May 17, 2018

确实是我的环境有问题,有4个包eclipse的jdk里面有,但是不会没有发布到Tomcat
参考
谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants