本文翻译自:Error - trustAnchors parameter must be non-empty
I'm trying to configure my e-mail on Jenkins/Hudson, and I constantly receive the error: 我正在尝试在Jenkins / Hudson上配置我的电子邮件,并且不断收到错误消息:
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be
non-empty
I've seen a good amount of information online about the error, but I have not gotten any to work. 我已经在网上看到了大量有关该错误的信息,但是我没有得到任何帮助。 I'm using Sun's JDK on Fedora Linux (not OpenJDK). 我在Fedora Linux(不是OpenJDK)上使用Sun的JDK。
Here are a few things I've tried. 这是我尝试过的几件事。 I tried following the advice from this post , but copying the cacerts from Windows over to my Fedora box hosting Jenkins didn't work. 我试着从以下这个建议后 ,但复制从Windows的cacerts到托管詹金斯没有工作,我的Fedora箱。 I tried following this guide as I'm trying to configure Gmail as my SMTP server, but it didn't work either. 在尝试将Gmail配置为SMTP服务器时,我尝试按照本指南进行操作,但是该方法也不起作用。 I also tried to download and move those cacert files manually and move them over to my Java folder using a variation of the commands on this guide . 我还尝试手动下载并移动这些cacert文件,并使用本指南中各种命令将它们移动到Java文件夹中。
I am open to any suggestions as I'm currently stuck right now. 我愿意接受任何建议,因为我目前仍处于停滞状态。 I have gotten it to work from a Windows Hudson server, but I am struggling on Linux. 我已经从Windows Hudson服务器上运行了它,但是我在Linux上苦苦挣扎。
#1楼
参考:https://stackoom.com/question/SSwp/错误-trustAnchors参数必须为非空
#2楼
I ran into this solution from blog post Fixing the trustAnchors problem when running OpenJDK 7 on OS X : 我在博客文章《 解决在OS X上运行OpenJDK 7时的trustAnchors问题》中遇到了这个解决方案:
Fixing the trustAnchors problem when running OpenJDK 7 on OS X. If you're running OpenJDK 7 on OS X and have seen this exception: 在OS X上运行OpenJDK 7时,解决了trustAnchors问题。如果在OS X上运行OpenJDK 7,并已看到此异常:
Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
There's a simple fix. 有一个简单的解决方法。 Just link in the same cacerts file that Apple's JDK 1.6 uses: 只需链接到Apple JDK 1.6使用的cacerts文件中即可:
cd $(/usr/libexec/java_home -v 1.7)/jre/lib/security
ln -fsh /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts
You need to do this for every OpenJDK version you have installed. 您需要为已安装的每个OpenJDK版本执行此操作。 Just change -v 1.7
to the version you want to fix. 只需将-v 1.7
更改为要修复的版本即可。 Run /usr/libexec/java_home -V
to see all the JREs and JDKs you have installed. 运行/usr/libexec/java_home -V
以查看您已安装的所有JRE和JDK。
Perhaps the OpenJDK guys could add this to their install scripts. 也许OpenJDK家伙可以将其添加到他们的安装脚本中。
#3楼
In Ubuntu 12.10 (Quantal Quetzal) or later, the certificates are held in the ca-certificates-java package. 在Ubuntu 12.10 (Quantal Quetzal)或更高版本中,证书保存在ca-certificates-java软件包中。 Using -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts
will pick them up regardless of what JDK you're using. 无论使用什么JDK,使用-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts
都会选择它们。
#4楼
I ran into this exact problem on OS X, using JDK 1.7, after upgrading to OS X v10.9 (Mavericks). 在升级到OS X v10.9 (Mavericks)之后,我在使用JDK 1.7的OS X上遇到了这个确切的问题。 The fix that worked for me was to simply reinstall the Apple version of Java, available at http://support.apple.com/kb/DL1572 . 对我有用的修补程序是简单地重新安装Apple版本的Java,可从http://support.apple.com/kb/DL1572获得 。
#5楼
I also encountered this on OS X after updating OS X v10.9 (Mavericks), when the old Java 6 was being used and tried to access an HTTPS URL. 当使用旧的Java 6并尝试访问HTTPS URL时,在更新OS X v10.9(Mavericks)之后,我也在OS X上遇到了此问题。 The fix was the inverse of Peter Kriens; 解决的方法是彼得·克林斯(Peter Kriens)的反面。 I needed to copy the cacerts
from the 1.7 space to the location linked by the 1.6 version: 我需要将cacerts
从1.7空间复制到1.6版本链接的位置:
(as root)
umask 022
mkdir -p /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security
cp $(/usr/libexec/java_home -v 1.7)/jre/lib/security/cacerts \
/System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security
#6楼
I've had lot of security issues after upgrading to OS X v10.9 (Mavericks): 升级到OS X v10.9 (Mavericks)后,我遇到了很多安全问题:
- SSL problem with Amazon AWS Amazon AWS的SSL问题
- Peer not authenticated with Maven and Eclipse 对等方未通过Maven和Eclipse进行身份验证
-
trustAnchors
parameter must be non-emptytrustAnchors
参数必须为非空
I applied this Java update and it fixed all my issues: http://support.apple.com/kb/DL1572?viewlocale=en_US 我应用了此Java更新,并修复了所有问题: http : //support.apple.com/kb/DL1572?viewlocale=zh_CN