I just realized that to be able to open/share the same Derby database from two different web applications running in the same Tomcat instance (same JVM) you’ll need to put derby.jar in the $TOMCAT_HOME/common/lib and remove it from your applications WEB-INF/lib. I got the clue from this RIFE web page
the jarfiles you need are derby.jar and derbytools.jar . Due to classloader peculiarities, don’t copy them to your application’s web/WEB-INF/lib/ subdirectory, or to Tomcat’s shared/lib/ directory. Tomcat’s common/lib/ directory works, and probably common/endorsed/ does too.