Java NoSuchAlgorithmException - SunJSSE,sun.security.ssl.SSLContextImpl $ DefaultSSLContext [英] Java NoSuchAlgorithmException - SunJSSE, sun.security.ssl.SSLContextImpl$DefaultSSLContext

查看:1896
本文介绍了Java NoSuchAlgorithmException - SunJSSE,sun.security.ssl.SSLContextImpl $ DefaultSSLContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

我一直在自己的Eclipse项目中使用Authorize.net SDK。一切都很好。然后我需要将其添加到我的主要项目中。我将依赖关系添加到类路径并复制到我需要的代码块中。这应该是有效的。

I have been using the Authorize.net SDK in an Eclipse project of it's own. Everything was working great. I then needed to add it to my main project. I added the dependencies to the class path and the copied in the block of code that I needed. It should have worked.

问题

长篇小说,代码会在我放置的地方工作。但是,当我将它直接提交给项目的主要方法时,它将会起作用。

Long story short, the code wouldn't work where I placed it. However, it will work when I bring it right out to the main method in the project.

在这个地方,我将无法使用调试器并发现以下异常:

In the place it won't work I stepped through the code with the debugger and found the following exception:

java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)

抛出: p>

thrown at:

HttpResponse httpResponse = httpClient.execute(httpPost);

注意:httpClient = DefaultHttpClient

Note: httpClient = DefaultHttpClient from Apache

我现在完全陷入困境不要造成这个错误。在Eclipse中,两个产品似乎都是针对同一个JRE。他们也都有httpclient-4.0.1.jar。请注意,有问题的项目还有一些其他依赖关系,即工作项目不会{boneCP,guava,mysql_connector_java,protobuf}

I'm completely stumped now. Don't what is causing this error. In Eclipse both products appear to be targeting the same JRE. They also both have httpclient-4.0.1.jar. Note that The problematic project also has some other dependencies that the working project doesnt { boneCP, guava, mysql_connector_java, protobuf }

我不认为额外的罐是原因因为问题代码在项目中的不同位置工作。

I don't think the extra jars are the cause as the problem code works at a different location in the project.

对于什么是错误的任何想法都非常感激,我花了一天调试这个,不要知道下一步去哪里。

Any ideas on what is wrong are greatly appreciated, i've spent the day debugging this and don't know where to go next.

谢谢。

推荐答案

做一些更多的搜索我发现错误可能与其他问题可能与无效的密钥库,密码等相关。

Well after doing some more searching I discovered the error may be related to other issues as invalid keystores, passwords etc.

然后我记得我已经设置了两个VM参数,当我是测试SSL用于我的网络连接。

I then remembered that I had set two VM arguments for when I was testing SSL for my network connectivity.

我删除了以下VM参数来解决问题:

I removed the following VM arguments to fix the problem:

-Djavax.net.ssl.keyStore=mySrvKeystore -Djavax.net.ssl.keyStorePassword=123456

注意:此密钥库不再存在所以这可能是为什么例外。

Note: this keystore no longer exists so that's probably why the Exception.

这篇关于Java NoSuchAlgorithmException - SunJSSE,sun.security.ssl.SSLContextImpl $ DefaultSSLContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆