问题描述
在处理不同的问题(与RMI相关)时,我使用无限强度策略文件升级了系统的安全文件夹,现在我的应用程序以不同的方式失败。我得到一个很长的堆栈转储,其后面的位似乎是相关的:
In working on a different problem (related to RMI), I upgraded the system's "security folder" with the "unlimited strength" policy files and now my applicaiton fails in a different way. I get a long stack dump, of which following bits appear pertinent:
Exception in thread "main" java.lang.ExceptionInInitializerError
[...crop...]
Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:86)
... 17 more
Caused by: java.lang.SecurityException: The jurisdiction policy files are not signed by a trusted signer!
[...crop...]
嗯,WTF?唯一的变化是我将orignal jar文件放在一边,并在$ JAVA_HOME / lib / security中添加了无限制的文件。该目录现在看起来像这样:
Um, WTF? The ONLY change was that I moved the orignal jar files aside and added the unlimited ones in $JAVA_HOME/lib/security. That directory now looks like this:
$ ls
blacklist javaws.policy trusted.libraries
cacerts local_policy.jar US_export_policy.jar
java.policy local_policy.jar.strong US_export_policy.jar.strong
java.security local_policy.jar.unlimited US_export_policy.jar.unlimited
当然,.strong和.unlimited版本都在那里,所以我可以快速切换回来。
Of course, the .strong and .unlimited version are there so I can switch back quickly.
方向简短明了,似乎只能设想替换这两个文件(local_policy.jar和US_exportpolicy.jar)。
The directions were short and plain, and it would appear that they ONLY envision the replacement of these two files (local_policy.jar and US_exportpolicy.jar).
还有什么其他的可以吗?
What else is there to do?
请注意,java和策略文件的版本是迄今为止最年轻的版本:1.7.0_03和jce_policy-6。
Note that the versions of java and the policy files are the very youngest to date: 1.7.0_03, and jce_policy-6, respectively.
PS相似标题的文章,发现,完全没有帮助。
P.S. The article of similar title, found here, was of no help at all.
推荐答案
您应该使用
这篇关于java.lang.SecurityException:管辖区策略文件未由可信签署者签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!