JDBC 驱动程序不适用于 Spring Roo 上的“org.postgresql.Driver”

2024-04-29

我正在尝试使用database reverse engineer...请参阅完整的 Roo v1.3 脚本和 UBUNTU 环境:这个简单的“你好”脚本 https://github.com/ppKrauss/dummy-java-spring/blob/master/roo1/hello3pg.md.

错误:

Located add-ons that may offer this JDBC driver
2 found, sorted by rank; T = trusted developer; R = Roo 1.3 compatible
ID T R DESCRIPTION -------------------------------------------------------------
01 Y Y 9.1.0.901-1_0001 Postgres #jdbcdriver...
02 Y Y 9.1.0.901_0001 Postgres #jdbcdriver...
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
JDBC driver not available for 'org.postgresql.Driver'

NOTES

这是一个变体spring.io/spring-roo http://projects.spring.io/spring-roo/#running-from-shell快速指南 10 行示例。很简单...

这是在项目和数据库 Roo 初始化之后(并且工作正常),

project --topLevelPackage   com.testRoo1Hello2pg
jpa setup --provider HIBERNATE --database POSTGRES --databaseName hello2db --userName postgresql --password postgres

database.properties 似乎:

database.driverClassName=org.postgresql.Driver
database.url=jdbc\:postgresql\://localhost\:5432/hello2db
database.username=postgresql
database.password=postgres

spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.hibernate.ddl-auto=create-drop

失败的命令是:

database reverse engineer --schema public --includeTables "test1"

See roo1/hello3pg.md https://github.com/ppKrauss/dummy-java-spring/blob/master/roo1/hello3pg.md更多细节。


Spring Roo shell 向您显示的消息不是错误。让我们检查一下:

Located add-ons that may offer this JDBC driver
2 found, sorted by rank; T = trusted developer; R = Roo 1.3 compatible
ID T R DESCRIPTION -------------------------------------------------------------
01 Y Y 9.1.0.901-1_0001 Postgres #jdbcdriver...
02 Y Y 9.1.0.901_0001 Postgres #jdbcdriver...
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
JDBC driver not available for 'org.postgresql.Driver'

执行后出现此消息database reverse engineer --schema public --includeTables "test1"命令。

Spring Roo 正在尝试连接 Postgres 数据库,但是.. 哦哦... OSGi 上下文中部署的 Postgres 数据库不存在 JDBC 驱动程序(请记住 Spring Roo 在 OSGi 环境下工作),因此无法连接D B。

Spring Roo shell 为您提供了一些选项来解决上述问题。因此,如果您阅读了该消息,您可以检查是否能够使用以下命令将 Postgres JDBC 驱动程序安装到 OSGi 上下文中。

addon install bundle --searchResultId 01

(01 id为ID栏下的数字)

执行安装 OSGi 包的命令后,尝试再次执行逆向工程命令。

那应该有效!

希望能帮助到你,

NOTE:如果您有兴趣了解有关 OSGi 和 Apache Felix 实现的更多信息,您可以阅读http://felix.apache.org/ http://felix.apache.org/ and https://www.osgi.org/developer/specifications/ https://www.osgi.org/developer/specifications/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

JDBC 驱动程序不适用于 Spring Roo 上的“org.postgresql.Driver” 的相关文章