JDBC driver not available for 'org.postgresql.Driver' on Spring Roo

烂漫一生 提交于 2019-12-02 12:07:30

The message that the Spring Roo shell is showing you is not an error. Let's check it:

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'

This message appears after execute the database reverse engineer --schema public --includeTables "test1" commands.

Spring Roo is trying to connect Postgres database but.. oh oh... there's not exists a JDBC Driver for the Postgres database deployed in the OSGi context (remember that Spring Roo works under OSGi environment), so it's not possible to connect with the DB.

Spring Roo shell is offering you some options to resolve the problem above. So, if your read the message, you could check that you are able to use the following command to install the Postgres JDBC driver into the OSGi context.

addon install bundle --searchResultId 01

(01 id is the number under the ID column)

After execute the command to install the OSGi bundle, try to execute the reverse engineer command again.

That should work!

Hope it helps,

NOTE: If you are interested in know more about OSGi and the Apache Felix implementation you could read http://felix.apache.org/ and https://www.osgi.org/developer/specifications/

unzurdo

I tried both

addon install bundle --searchResultId 01

and

addon install bundle --searchResultId 02

and was still getting the no driver found message JDBC driver not available for 'org.postgresql.Driver'.

What did work for me was to install the previous version of the bundle.

osgi install --url  http://spring-roo-repository.springsource.org/release/org/springframework/roo/wrapping/org.springframework.roo.wrapping.postgresql-jdbc3/9.0.801.0001/org.springframework.roo.wrapping.postgresql-jdbc3-9.0.801.0001.jar

I'm using PostgreSQL 9.4 running on a docker container.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!