我正在使用 Karaf 4.4.3 和 Postgres JDBC 42.6.0 并尝试创建 PGSimpleDataSource
PGSimpleDataSource dataSource = new PGSimpleDataSource();
但是当卡拉夫开始java.lang.ClassNotFoundException: javax.sql.DataSource cannot be found by ***
时出现异常。可能是什么原因以及如何解决?
我已经安装了以下功能,但没有帮助
jdbc/1.5.5, \
pax-jdbc/1.5.5, \
pax-jdbc-postgresql/1.5.5, \
pax-jdbc-config/1.5.5, \
我已经解决了我的问题。我将 javax.sql 添加到 Karaf config.properties 文件中。
org.osgi.framework.bootdelegation = \
com.sun.*, \
javax.sql, \
javax.naming, \
javax.transaction, \
javax.transaction.xa, \
# other default stuff goes here