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

后端 未结 2 1853
孤城傲影
孤城傲影 2021-01-28 18:31

I am trying to use database reverse engineer... See full Roo v1.3 script and UBUNTU env at this simple \"hello\" script.

The error:

Located          


        
相关标签:
2条回答
  • 2021-01-28 18:41

    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/

    0 讨论(0)
  • 2021-01-28 18:41

    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.

    0 讨论(0)
提交回复
热议问题