Geotoolkit

JavaDB connection error when stopping Tomcat

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 3.00, 3.01, 3.02, 3.03
  • Fix Version/s: 3.04
  • Component/s: Referencing
  • Labels:
    None

Description

When stopping a Tomcat application server, this error comes (reformated for reading purpose):

12 juin 2009 15:00:53 org.apache.catalina.loader.WebappClassLoader findResourceInternal
INFO: Illegal access: this web application instance has been stopped already.
    Could not load org/apache/derby/info/DBMS.properties.
    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.

12 juin 2009 15:00:53 org.apache.catalina.loader.WebappClassLoader findResourceInternal
INFO: Illegal access: this web application instance has been stopped already. Could not load org/apache/derby/info/DBMS.properties.
    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.

Exception in thread "Factories shutdown" java.lang.NullPointerException
    at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at org.geotoolkit.referencing.factory.epsg.ThreadedEpsgFactory.shutdown(ThreadedEpsgFactory.java:336)
    at org.geotoolkit.referencing.factory.epsg.ThreadedEpsgFactory.dispose(ThreadedEpsgFactory.java:676)
    at org.geotoolkit.factory.ShutdownHook.run(ShutdownHook.java:82)
12 juin 2009 15:00:53 org.constellation.catalog.Database close
INFO: Database connection closed.

It seems the JavaDB connection to the EPSG database fails at closing-time.

Issue Links

Activity

Hide
Martin Desruisseaux added a comment - 23/Sep/2009 15:10

This error is probably caused by the JavaDB library being declared unavailable by the Tomcat container while Geotk still need JavaDB in its shutdown hook. This bug does not appear in desktop applications; maybe the Tomcat container is "disabling" a library like JavaDB more aggressively than what desktop JVM does.

This bug does not occur if JavaDB is declared in the Tomcat's common/lib directory, in which case JavaDB has a longer livetime than Geotk. Or yet better, it does not happen when using Glassfish and its provided JavaDB service.

Generally speaking, we should strongly warn against injecting a JavaDB dependencies straight in a WAR file to be deployed in a container. Database engines should be managed by the container, either natively like Glassfish, or by adding the JavaDB library in the common/lib directory for Tomcat. Failing to do so causes many problem, including but not limited to the issue reported here. An other problem is the "driver not found" error message if the application containing the JavaDB library is undeployed and redeployed.

This is going to be documented here: http://www.geotoolkit.org/modules/referencing/geotk-epsg-javadb/index.html

Show
Martin Desruisseaux added a comment - 23/Sep/2009 15:10 This error is probably caused by the JavaDB library being declared unavailable by the Tomcat container while Geotk still need JavaDB in its shutdown hook. This bug does not appear in desktop applications; maybe the Tomcat container is "disabling" a library like JavaDB more aggressively than what desktop JVM does. This bug does not occur if JavaDB is declared in the Tomcat's common/lib directory, in which case JavaDB has a longer livetime than Geotk. Or yet better, it does not happen when using Glassfish and its provided JavaDB service. Generally speaking, we should strongly warn against injecting a JavaDB dependencies straight in a WAR file to be deployed in a container. Database engines should be managed by the container, either natively like Glassfish, or by adding the JavaDB library in the common/lib directory for Tomcat. Failing to do so causes many problem, including but not limited to the issue reported here. An other problem is the "driver not found" error message if the application containing the JavaDB library is undeployed and redeployed. This is going to be documented here: http://www.geotoolkit.org/modules/referencing/geotk-epsg-javadb/index.html

People

Vote (0)
Watch (0)

Dates

  • Created:
    17/Aug/2009 14:37
    Updated:
    23/Sep/2009 15:10
    Resolved:
    23/Sep/2009 15:10