On 08/11/2011 08:47, Jan Vávra wrote:
> Hello,
> I have a problem with loading bouncy castle.
> My code snippet is:
>
> int position = Security.addProvider(new BouncyCastleProvider());
> KeyStore store = KeyStore.getInstance("PKCS12", "BC");
>
> In the application log I have message that BouncyCastleProvider is
> already loaded (position== -1).
> But call of getInstance(.) failed with exception:
> java.security.KeyStoreException: PKCS12 not found
> Caused by: java.security.KeyStoreException: PKCS12 not found
> Caused by: java.security.NoSuchAlgorithmException: class configured for
> KeyStore(provider: BC)cannot be found
> Caused by: java.lang.ClassNotFoundException:
> org.bouncycastle.jce.provider.JDKPKCS12KeyStore$BCPKCS12KeyStore
>
> class JDKPKCS12KeyStore$BCPKCS12KeyStore is contained in
> webapps/appX/WEB-INF/lib/bcprov-ext-jdk16-146.jar
>
> In the catalina log there is a message:
> Nov 8, 2011 8:34:22 AM org.apache.catalina.loader.WebappClassLoader
> loadClass
> INFO: Illegal access: this web application instance has been stopped
> already. Could not load
> org.bouncycastle.jce.provider.JDKPKCS12KeyStore$BCPKCS12KeyStore. The
> eventual following stack trace is caused by an error thrown for
> debugging purposes as well as to attempt to terminate the thread which
> caused the illegal access, and has no functional impact.
> java.lang.IllegalStateException
>
> On the tomcat I have 2 more applications that use the same version of
> bcprov-ext. Each has it in own WEB-INF/lib directory.
>
> Could anybody give me an advice?
> Why tomcat does complaint about "Illegal access"?
> Is there any way how to debug work of
> org.apache.catalina.loader.WebappClassLoader?
>
> My tomcat version is:
> Apache Tomcat/6.0.29 1.6.0_22-b04 Sun Microsystems Inc.
> Linux 2.6.32.36-0.5-default amd64Try putting the jar in tomcat/lib instead of in each webapp. p -- [key:62590808]
signature.asc
Description: OpenPGP digital signature
