Andrea Girardi
Andrea Girardi

Reputation: 4437

Startup jackrabbit standalone with postgres

I need to start jackrabbit with postgresql persistence support enabled. I changed the repository.xml configuration file adding the right properties to connect db but I'm not able to set the class path and, for that reason, this exception is raised:

Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver

I use:

java -jar jackrabbit-standalone-2.2.10.jar -c ./repository.xml -p 8081 -d

how can I tell java where is the jdbc postgres jar file? with -jar any class path definition is ignored.

thanks, Andrea

Upvotes: 0

Views: 1196

Answers (1)

Jukka Zitting
Jukka Zitting

Reputation: 1092

The easiest solution is probably to place the PostgreSQL JDBC driver into the lib/ext directory of your JRE. That way the PostgreSQL driver would be available in the system classpath also to applications started with java -jar.

If you don't want to modify your global JRE settings, you could also explicitly invoke the jackrabbit-standalone Main class with normal classpath settings, like this:

java -cp jackrabbit-standalone.jar:postgresql.jar \
    org.apache.jackrabbit.standalone.Main -c ./repository.xml -p 8081 -d

Upvotes: 1

Related Questions