我在Eclipse中遇到以下Java运行时错误。有谁可以帮我解决这个问题。我在编译时得到以下异常。我无法继续前进。请帮忙
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: org.apache.ws.security.components.crypto.BouncyCastle Not Found
at org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFactory.java:111)
at org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:72)
at webSecurity.WebSecuritySample.getCrypto(WebSecuritySample.java:291)
at webSecurity.WebSecuritySample.access$0(WebSecuritySample.java:270)
at webSecurity.WebSecuritySample$WSSecuritySample.<clinit>(WebSecuritySample.java:79)
我的代码如下所示......
private static final Crypto crypto = getCrypto();
private static Crypto getCrypto(){
String cryptoClassName = "org.apache.ws.security.components.crypto.BouncyCastle";
properties.put("org.apache.ws.security.crypto.provider", cryptoClassName);
properties.put("org.apache.ws.security.components.crypto.BouncyCastle.keystore.type", "pkcs12");
properties.put("org.apache.ws.security.components.crypto.BouncyCastle.keystore.password", "abcd2013");
properties.put("org.apache.ws.security.components.crypto.BouncyCastle.keystore.alias", "abcd");
properties.put("org.apache.ws.security.components.crypto.BouncyCastle.alias.password","abcd2013");
properties.put("org.apache.ws.security.components.crypto.BouncyCastle.file ","C:\\Selenium\\WorkSpace\\abcd.pfx");
Crypto crypto = CryptoFactory.getInstance(cryptoClassName, properties);
return crypto;
}
使用的Jar文件: wss4j2.1.jar,axis.jar,wsdl4j1.5.1.jar。