Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

H2 datasource should be relative to webapp root #240

@GoogleCodeExporter

Description

@GoogleCodeExporter
applicationContext.xml defines the following H2 datasource URL : 
jdbc:h2:${catalina.base}/webapps/connector-manager/WEB-INF/connector_manager.dbs
tore/connector-manager

This is not ideal since it causes problems when the webapp is run within 
Eclipse: WARs run from Eclipse are deployed in a shallow Tomcat directory 
structure under a "wtpwebapps" folder (as opposite to "webapps"). This causes 
the H2 database to be written in a completely separate location from the 
deployed app.

It also has other drawbacks such as:
- Tying the app. to Tomcat via ${catalina.base}: Although I understand this is 
the only supported container, loosening dependencies never hurts.
- It assumes it's deployed under a /connector-manager path which might not be 
the case.

Suggestion is to add a org.springframework.web.util.WebAppRootListener 
<listener> just before the com.google.enterprise.connector.servlet.StartUp one, 
then use the following URL: 
jdbc:h2:${webapp.root}/WEB-INF/connector_manager.dbstore/connector-manager... 
to have it relative to the WAR location.

Original issue reported on code.google.com by nicolas@guillaumin.me on 28 Dec 2012 at 5:17

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions