JDBC驱动程序不适用于' org.postgresql.Driver'在春天的路上

时间:2016-12-16 17:39:24

标签: spring-roo

我正在尝试使用database reverse engineer ...请参阅this simple "hello" script处的完整Roo v1.3脚本和UBUNTU环境。

错误:

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'

注意

这是spring.io/spring-roo快速指南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"

有关详细信息,请参阅roo1/hello3pg.md

2 个答案:

答案 0 :(得分:2)

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环境下工作),所以它无法连接数据库。

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

addon install bundle --searchResultId 01

(01 id是ID列下的数字)

执行安装OSGi包的命令后,尝试再次执行reverse engineer命令。

这应该有用!

希望它有所帮助,

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

答案 1 :(得分:1)

我试过了两次

let
    Source = Excel.CurrentWorkbook(){[Name="ListIDs"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each WikiLookUp([ID])),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Cardinal", "Ordinal", "Factorization", "Divisors"}, {"Cardinal", "Ordinal", "Factorization", "Divisors"})
in
    #"Expanded Custom"

addon install bundle --searchResultId 01

并且仍然收到无驱动程序的消息addon install bundle --searchResultId 02

为我工作的是安装以前版本的捆绑包。

JDBC driver not available for 'org.postgresql.Driver'

我正在使用在docker容器上运行的PostgreSQL 9.4。