HIPPO with Postgres

Dear expert,

CE HIPPO has being good to me so far and now I am connecting my HIPPO JCR Container to a PostgreSQL database.

I have done all the necessary that is.

  1. I have installed PostgreSQL 9.5

Following https://www.onehippo.org/library/deployment/configuring/configuring-hippo-for-postgresql.html

  1. created a repository.xml @ HIPPO/conf/repository.xml

  2. Update the HIPPO/conf/context.xml with a resource tag for postgres

Then I run a :
mvn clean verify
mvn -Pcargo.run -Drepo.config=conf/repository.xml


Got a new HIPPO storage, all seems OK but I got this error :
java.sql.SQLException: Cannot load JDBC driver class ‘org.postgresql.Driver’
and no changes in in the postgresql database.

4. Of course I need to add in the postgres JDBC Driver.

So I downloaded it from https://jdbc.postgresql.org/download/postgresql-42.2.5.jar
Then i found out I don’t know where to put it. The instruction was to place it in %Catalina%/lib but that folder keep getting removed and refresh every time I run HIPPO

So I realize this is maven so I need to download it via dependency.
I am following the values of : https://mvnrepository.com/artifact/org.postgresql/postgresql/42.2.5

There are many pom.xml in HIPPO, which one do I place it in?
HIPPO folder/pom.xml
HIPPO folder/cms/pom.xml
HIPPO folder/essentials/pom.xml
HIPPO folder/repository-data/pom.xml
HIPPO folder/site/pom.xml

Something out of HIPPO :blush: .
Is there a possibility after adding the dependency in pom.xml then I running mvn verify the postgresql driver is not downloaded into my maven repository?

Regards
Sola Lee

Check here https://www.onehippo.org/library/development/use-mysql-in-a-development-environment.html but do it for postgresql. You need to place it in cargo config for local dev

1 Like

Please note that we do not support Postgres for the community edition. This doesn’t mean it won’t work, but only that we don’t guarantee it.

1 Like

Thank you bcanvurat.

Perfect… that JDBC for Postgresql problem solved.

The issue was as bcanvurat stated.

Key thing for me to remember:

  1. Update the ROOT pom.xml

  2. Place the postgresql dependencies tags OUT the dependencyManagement tag NOT inside it.
    indent preformatted text by 4 spaces

    <dependencies>
    <dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.5</version>
    </dependency>
    </dependencies>

  3. Do the same inside the build/plugins/plugin/groupid for org.codehaus.cargo
    Replace the version tag with classpath tag with the value set as “extra”.

    <dependencies>
    <dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <classpath>extra</classpath>
    </dependency>
    </dependencies>

Once done you will notice the postgresql-42.2.5.jar is place in ALL your target lib folder

Example:
HIPPO Folder\cms\target\cms\WEB-INF\lib\postgresql-42.2.5.jar
HIPPO Folder\essentials\target\essentials\WEB-INF\lib\postgresql-42.2.5.jar
HIPPO Folder\site\target\site\WEB-INF\lib\postgresql-42.2.5.jar
HIPPO Folder\target\tomcat8x\common\lib\postgresql-42.2.5.jar
HIPPO Folder\target\tomcat8x\webapps\cms\WEB-INF\lib\postgresql-42.2.5.jar
HIPPO Folder\target\tomcat8x\webapps\essentials\WEB-INF\lib\postgresql-42.2.5.jar
HIPPO Folder\target\tomcat8x\webapps\site\WEB-INF\lib\postgresql-42.2.5.jar

Regards
Sola Lee

Dear Jasper,

Noted with thanks.