使用 postgres 独立启动 jackrabbit

发布于 2025-01-01 10:46:27 字数 412 浏览 0 评论 0原文

我需要在启用 postgresql 持久性支持的情况下启动 jackrabbit。我更改了repository.xml配置文件,添加了正确的属性来连接数据库,但我无法设置类路径,因此,引发了此异常:

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

我使用:

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

how can I告诉java where is the jdbc postgres jar 文件?使用 -jar 时,任何类路径定义都会被忽略。

谢谢, 安德里亚

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不弃不离 2025-01-08 10:46:27

最简单的解决方案可能是将 PostgreSQL JDBC 驱动程序放入 JRE 的 lib/ext 目录中。这样,PostgreSQL 驱动程序就可以在系统类路径中用于以 java -jar 启动的应用程序。

如果您不想修改全局 JRE 设置,您还可以使用正常的类路径设置显式调用 jackrabbit-standalone Main 类,如下所示:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文