[Geoserver-devel] [jira] Created: (GEOS-531) NullPointerException in GeoserverDataDirectory when data directory is packaged in the WAR

NullPointerException in GeoserverDataDirectory when data directory is packaged in the WAR
-----------------------------------------------------------------------------------------

         Key: GEOS-531
         URL: http://jira.codehaus.org/browse/GEOS-531
     Project: GeoServer
        Type: Bug

  Components: Configuration
    Versions: 1.3.0 PR1
Environment: Windows XP, Java 1.5, Jetty or WebLogic 9.1 container
    Reporter: Aksel Hilde
Assigned to: dblasby
    Priority: Blocker
     Fix For: 1.3.0

The problem seems to be that GeoserverDataDirectory only handles the default data directory when geoserver is deployed as a flat directory in the web container. Naturally this bug occours when GEOSERVER_DATA_DIR is not used. Then line 89-90 in GeoserverDataDirectory handles the job of creating a file referanse to the data dir:
    String rootDir = servContext.getRealPath("/");
    dataDir = new File (rootDir);

The NullPointer happens in the File constructor because servContext.getRealPath("/") return null when the web app is packaged in a WAR, as is also documented in the JEE api docs.

BTW: Using the GEOSERVER_DATA_DIR is not really wanted in my production environment because we want to deploy both the geoserver version and the data directory stuff together with our other ear/war deployment.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira