环境
项目用到了Activiti工作流引擎。 项目使用maven进行依赖管理。
遇到问题
项目使用的activiti版本是5.13,但是maven中央库中是从5.14开始的。 从网上找到https://maven.alfresco.com/nexus/content/groups/public/
这个仓库包含5.13版本。 但是配置完该仓库,使用maven从里面下载的时候出现了异常。java.lang.RuntimeException: Could not generate DH keypair
搜索解决方案
从网上搜,找到了:还有
解决方法
下面内容摘自上述第二个搜索结果:
Solution: The problem is “Prime size must be multiple of 64, and can only range from 512 to 1024″. The maximum-acceptable size that Java accepts is 1024 bits, this is a known issue . I tried using the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files, that did not work. The bug report mentioned using BouncyCastle’s JCE implementation to get around this problem.
- Download the BouncyCastle JCE jars. These particular links are for version 1.52 and work for Oracle Java 5 – Java 8. OR:
- Copy jars to $JAVA_HOME/jre/lib/ext
- Edit $JAVA_HOME/jre/lib/security/java.security as follows: a. Locate the “security.provider” section. Keep security.provider.1=sun.security.provider.Sun b. Locate “security.provider.2″ and make that “security.provider.3″. Do this for all the remaining “security.provider.n” values. c. Set “security.provider.2″ to org.bouncycastle.jce.provider.BouncyCastleProvider security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider
- Re-run the maven build and the errors should now be gone.