运行部署的htmlunit程序报错
开发完成的程序在eclipse中运行完好,这两天打包运行接连出现问题。
每一步都需要求助搜索引擎,百度、google真是太伟大了。
问题1:运行报错java.lang.NoClassDefFoundError: javax/activation/DataSource
在eclipse中并为主动引入该包,运行正常,发现已经包含在plugins下的javaee.jar中。
java发送邮件必备的jar包(mail.jar和activation.jar)
问题2:2010-08-27 13:36:41,604 [main] INFO - I/O exception (javax.net.ssl.SSLKeyExcep
ion) caught when processing request: RSA premaster secret error
2010-08-27 13:36:41,604 [main] INFO - Retrying request
java.lang.RuntimeException: javax.net.ssl.SSLKeyException: RSA premaster secret
error
at com.gargoylesoftware.htmlunit.WebClient.download(WebClient.java:2095)
at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:131)
at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:75)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1252)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1212)
at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1179)
Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider sup
orting RSA/ECB/PKCS1Padding
at javax.crypto.Cipher.getInstance(DashoA12275)
at com.sun.net.ssl.internal.ssl.JsseJce.getCipher(Unknown Source)
at com.sun.net.ssl.internal.ssl.RSACipher.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.RSACipher.getInstance(Unknown Source)
原因:运行在JDK1.5下,默认应该有该类,但却找不到。classpath中手工引入jre目录下jce.jar
和sunjce_provider.jar才运行成功。