我正在尝试将 Jsoup (1.7.2) 与 appengine (1.7.7) 一起使用,但在尝试连接时出现错误:
try {
doc = Jsoup.connect("http://www.google.com").get();
} catch (Exception e) {
e.printStackTrace();
}
我得到以下堆栈跟踪:
java.lang.NullPointerException
at java.util.Collections.addAll(Collections.java:3836)
at sun.security.ssl.AbstractTrustManagerWrapper.<init>(SSLContextImpl.java:778)
at sun.security.ssl.SSLContextImpl.chooseTrustManager(SSLContextImpl.java:133)
at sun.security.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:89)
at javax.net.ssl.SSLContext.init(SSLContext.java:283)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.createNonvalidatingScheme(LocalURLFetchService.java:254)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.createHttpClient(LocalURLFetchService.java:276)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.getNonValidatingClient(LocalURLFetchService.java:528)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.access$100(LocalURLFetchService.java:83)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService$8.run(LocalURLFetchService.java:439)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService$8.run(LocalURLFetchService.java:424)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.doPrivilegedExecute(LocalURLFetchService.java:424)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:392)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:521)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:475)
at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:452)
at java.util.concurrent.Executors$PrivilegedCallable$1.run(Executors.java:493)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedCallable.call(Executors.java:490)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)