I have a web application which allow user to deal with JAVA Keystore. I'm using BouncyCastle library to deal with PKCS#12 keystore. In order for my application to use BC provider, i need to instantiate the provider and add it into my Security Provider as followed :
// Instantiate the BouncyCastle provider
Class bcProvClass = Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
Provider bcProv = (Provider)bcProvClass.newInstance();
// Add BC as a security provider
The application works fine when the first time i run it. The problem arises after I redeploy my application (without restart JBoss) and my application trying to get the Keystore instance.
Code to get Keystore instance :
keyStore = KeyStore.getInstance(keyStoreType.toString(), "BC");
The error returned to me is :
01:17:50,064 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already (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)
01:17:50,134 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
any ideas how to overcome this?