[Geoserver-devel] [JIRA] (GEOS-9244) GeoServerPropertyConfigurer don't fill config file with default property values

Joanna Jółkowska created an issue

GeoServer / BugGEOS-9244

GeoServerPropertyConfigurer don’t fill config file with default property values

Issue Type:

BugBug

Assignee:

Unassigned

Created:

10/Jun/19 1:03 PM

Priority:

MediumMedium

Reporter:

Joanna Jółkowska

I can read in doc:

If the file <tt>myDirectory/myFile.properties</tt> exists then the property values will be loaded
from it, otherwise the defaults declared on the property configurer will be used. By default when
the resource is not found it will be copied out into the data directory. However

{@link #setCopyOutTemplate(boolean)}

can be used to control this.

However, if the configuration file does not exist, it will be created but empty.

This can be seen on the example of the geofence module. I compiled geoserver v.2.15.1 with geofence and goefence-server profiles and ran on an empty geoserver_data directory. The geofence directory has been created, including the geofence-db directory and files: geofence-datasource-ovr.properties, geofence-server.properties. However, these files are empty.

I see that the code that populates the file with the default values is located in the catch block in the loadProperties method:
https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/config/GeoServerPropertyConfigurer.java#L101
However, during debugging, I’ve observed that FileNotFoundException is never thrown by the loadProperties of the PropertiesLoaderSupport Spring class. After exiting this method, the file is already created (empty).

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100104-sha1:f3b996f)

Atlassian logo