使用 postgres 独立启动 jackrabbit
我需要在启用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的解决方案可能是将 PostgreSQL JDBC 驱动程序放入 JRE 的 lib/ext 目录中。这样,PostgreSQL 驱动程序就可以在系统类路径中用于以
java -jar
启动的应用程序。如果您不想修改全局 JRE 设置,您还可以使用正常的类路径设置显式调用 jackrabbit-standalone Main 类,如下所示:
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 withjava -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: