Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40CE69AFE for ; Tue, 8 Nov 2011 08:48:30 +0000 (UTC) Received: (qmail 40131 invoked by uid 500); 8 Nov 2011 08:48:26 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 40033 invoked by uid 500); 8 Nov 2011 08:48:26 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 40024 invoked by uid 99); 8 Nov 2011 08:48:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2011 08:48:25 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of vavra@602.cz designates 209.85.215.173 as permitted sender) Received: from [209.85.215.173] (HELO mail-ey0-f173.google.com) (209.85.215.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2011 08:48:15 +0000 Received: by eyh6 with SMTP id 6so216330eyh.18 for ; Tue, 08 Nov 2011 00:47:55 -0800 (PST) Received: by 10.14.9.225 with SMTP id 73mr2527737eet.62.1320742075443; Tue, 08 Nov 2011 00:47:55 -0800 (PST) Received: from [192.168.1.211] (94.112.242.230.static.b2b.upcbusiness.cz. [94.112.242.230]) by mx.google.com with ESMTPS id q28sm2240900eea.6.2011.11.08.00.47.54 (version=SSLv3 cipher=OTHER); Tue, 08 Nov 2011 00:47:54 -0800 (PST) Message-ID: <4EB8ECBA.6050901@602.cz> Date: Tue, 08 Nov 2011 09:47:54 +0100 From: =?ISO-8859-2?Q?Jan_V=E1vra?= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: problem with loading Bouncy Castle Content-Type: multipart/alternative; boundary="------------060601080005000206010101" X-Virus-Checked: Checked by ClamAV on apache.org --------------060601080005000206010101 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit 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 amd64 Thanks. Jan --------------060601080005000206010101--