WAR and EAR

Setup ››
Parent Previous Next

If your project is running in an Application server (WAR or EAR project) you may encounter strange exceptions after application start/stop.

You can skip this section if you do not plan to stop/start the application that uses the library.


The reason for these exceptions is that the library JAR files are bundled with the web application. Hence after an application stop/start, they are loaded in another class loader, while the BouncyCastle security provider was already registered with class loader that is unavailable (has been destroyed after the web application has stopped)

The solution to this situation is to ship the application without the library JAR files.

They must be placed in a folder shared for all applications running on the Application server.


Below are listed the shared folders for some application servers.


Glassfish

<glassfish folder>/domains/domain1/lib/

Tomcat 5.x

<tomcat folder>/shared/lib/


Tomcat 6.x

$CATALINA_BASE/lib/


Web Sphere (WAS)

<was folder>/lib


WebLogic

<weblogic folder>/common/lib


Note: If you application server is not mentioned here, please refer to your application server documentation in order to located the shared jar's folder.