Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#826 closed enhancement (fixed)

GeoNetwork data directory

Reported by: fxp Owned by: geonetwork-devel@…
Priority: major Milestone: v2.7.0
Component: General Version:
Keywords: Cc:

Description

Attachments (1)

826.patch (104.9 KB ) - added by fxp 13 years ago.

Download all attachments as: .zip

Change History (5)

by fxp, 13 years ago

Attachment: 826.patch added

comment:1 by fxp, 13 years ago

Resolution: fixed
Status: newclosed

Committed revision 8879.

comment:2 by landry, 12 years ago

I have an issue with that changeset. If i set my geosource build (from trunk) datadir to say, /tmp/geonetwork (via <param-name>geonetwork.dir</param-name> in web.xml) then geosource fails to create the images/logos subdir at startup in that dir.

Traceback is :

SEVERE: StandardWrapper.Throwable java.lang.AssertionError: Unable to create the images/logos directory. Permissions problem? null/images/logos

at org.fao.geonet.resources.Resources.locateLogosDir(Resources.java:68) at org.fao.geonet.Geonetwork.createSiteLogo(Geonetwork.java:692) at org.fao.geonet.Geonetwork.start(Geonetwork.java:422)

If i add some debug info in locateLogosDir, it gets passed :

a not-null context a not-null appDir (/var/lib/tomcat6/webapps/geonetwork-private/) but locateResourcesDir returns null. If i look for this func, there are two slightly different implementations with the same signature, and the second one is called (ie the one with System.getProperty(context.getServletContextName()+".resources.dir");)

If i look more closely in my case, context.getServletContextName() is 'geosource' and not 'geonetwork'. Anyway, I would have assumed from the diff and the commit made that the resources dir, if not set, defaulted to datadir/resources, instead of being undefined here.

I've tried setting geosource.resources.dir in web.xml, but it doesnt seem to be reached by locateResourcesDir() which still returns null. So, my workaround so far is to hack around locateLogosDir() and hardcode path to a subdir of /tmp/geonetwork, which i know works. But i'd definitely welcome a better fix, ie having the resources dir gracefully default to a subdir of datadir.

comment:3 by landry, 12 years ago

Correction. Setting the resource dir only works if passing -Dgeosource.resources.dir=/tmp/geosource_res to the tomcat commandline java options. That way it's created at tomcat startup, but this is not really consistent with the way to set the datadir through web.xml.

comment:4 by landry, 12 years ago

And finally, i don't know if it's still related to the datadir, but with that setting geosource doesnt register any schema and /tmp/geosource_data/config/schemaplugin-uri-catalog.xml links to no schema. The admin interface doesnt even show the schemas supposedly bundled by geonetwork, i had to manually copy iso19139 and iso19139.fra dirs to /tmp/geosource_data/config/schema_plugins to see them.

Note: See TracTickets for help on using tickets.