Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Problem getting started with DBRE

  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Default Problem getting started with DBRE

    I am using Roo 1.2.0.M1 [rev 1fa252f]

    I have some troubles getting started with DBRE; I can't make Roo accept H2 as my database.

    Here's what I have done so far:
    Code:
    project --topLevelPackage se.ic.log --projectName LogViewer --java 6
    jpa setup --database H2_IN_MEMORY --provider HIBERNATE
    database properties set --key database.url --value jdbc:h2:tcp://localhost/~/h2db/afa
    // [failed] database introspect --schema no-schema-required
    addon install bundle --bundleSymbolicName org.springframework.roo.wrapping.h2;1.3.160.0001
    // [failed] database introspect --schema no-schema-required
    addon install id --searchResultId 01
    // [failed] database introspect --schema no-schema-required
    Every time i have tried the failed database introspect command, I get the following output:

    Code:
    Located add-on that may offer this JDBC driver
    1 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
    ID T R DESCRIPTION -------------------------------------------------------------
    01 Y Y 1.3.160.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle...
    --------------------------------------------------------------------------------
    [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.h2.Driver'
    It seems to me my adding of the h2 bundle should fix the problem, but I am getting nowhere.

    Could someone please explain to me what I should do.

  2. #2
    Join Date
    Dec 2005
    Posts
    930

    Default

    Did you execute the the command addon install id --searchResultId 1 when prompted above? You should see as a result
    Code:
    roo> addon install id --searchResultId 1
    Target resource(s):
    -------------------
       Spring Roo - Wrapping - h2 (1.3.161.0001)
    
    Deploying...done.
    
    Successfully installed add-on: Spring Roo - Wrapping - h2 [version: 1.3.160.0001]
    [Hint] Please consider rating this add-on with the following command:
    [Hint] addon feedback bundle --bundleSymbolicName org.springframework.roo.wrapping.h2 --rating ... --comment "..."
    roo>
    Alan
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    Nov 2011
    Posts
    4

    Default

    Yes, I did try to install the module, and the output indicates that it went well. That is why I am stuck: The installation seems to have gone well, but every time I try to get further with the "database introspect" command, it's the same error again.


    Code:
    roo> database introspect --schema no-schema-required
    Located add-on that may offer this JDBC driver
    1 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
    ID T R DESCRIPTION -------------------------------------------------------------
    01 Y Y 1.3.160.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle...
    --------------------------------------------------------------------------------
    [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.h2.Driver'
    roo> addon install id --searchResultId 1
    roo> Target resource(s):
    -------------------
       Spring Roo - Wrapping - h2 (1.3.161.0001)
    
    Optional resource(s):
    ---------------------
       slf4j-api (1.6.1)
       Servlet Specification API (2.5.0)
       slf4j-nop (1.6.1)
    
    Deploying...done.
    
    roo>

  4. #4
    Join Date
    Dec 2005
    Posts
    930

    Default

    H2 is normally configured as an in memory database in Roo, so to use with DBRE you either to have to run the db in server mode or spin up a web app, otherwise the database in not active and cannot be connected to.
    Alan
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  5. #5
    Join Date
    Nov 2011
    Posts
    4

    Default

    Thanks for your quick replies, Alan!

    I should have mentioned that I had the H2 database server running when I tried the above, so that is not the reason for it to fail.

    Another thing I didn't mention is that I was running Roo 1.2.0.M1 from within STS 2.8.0.RELEASE. I now tried to do the same thing but from a command window (under Windows), i.e. running Roo 1.2.0.M1 in a shell. And then it works! So it seems to me that the trouble I have has something to do with the interaction of STS and Roo.

    Could this possibly be a bug in STS or Roo, or a mismatch of the versions? I can live with doing this in the command shell, but if you want me to suppply more info for debugging purposes, I'd be happy to do so.

  6. #6
    Join Date
    Dec 2005
    Posts
    930

    Default

    Try the latest snapshot at http://static.springsource.org/downl...hp?project=ROO in STS 2.8.0 before deciding if there is a bug or not. There have been may changes since M1.
    Alan
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  7. #7
    Join Date
    Dec 2005
    Posts
    930

    Default

    sorry, duplicate
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  8. #8
    Join Date
    Nov 2011
    Posts
    4

    Default

    Same problem with the latest snapshot (1.2.0.BUILD-SNAPSHOT [rev e59dc66]).

  9. #9
    Join Date
    Dec 2005
    Posts
    930

    Default

    I tested the latest snapshot in STS and I was able to get the H2 driver and instrospect the DB ok:

    Code:
    roo> database introspect --schema unable-to-obtain-connection 
    Located add-on that may offer this JDBC driver
    1 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
    ID T R DESCRIPTION -------------------------------------------------------------
    01 Y Y 1.3.160.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle...
    --------------------------------------------------------------------------------
    [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.h2.Driver'
    roo> 
    roo> addon install id --searchResultId 1
    roo> Target resource(s):
    -------------------
       Spring Roo - Wrapping - h2 (1.3.161.0001)
    
    Optional resource(s):
    ---------------------
       slf4j-api (1.6.1)
       Servlet Specification API (2.5.0)
       slf4j-nop (1.6.1)
    
    Deploying...done.
    
    roo> 
    roo> database introspect --schema INFORMATION_SCHEMA 
    Schema(s) 'INFORMATION_SCHEMA' do not exist or does not have any tables. Note that the schema names of some databases are case-sensitive
    roo>
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  10. #10
    Join Date
    Jan 2012
    Posts
    11

    Default

    Hi,

    I have the same problem. I'm reading the 'Getting Started with Roo' book, i'm executing the H2 database example for DBRE and i obtain the same error:

    roo> database reverse engineer --package ~.domain --schema PUBLIC
    Located add-on that may offer this JDBC driver
    1 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
    ID T R DESCRIPTION -------------------------------------------------------------
    01 Y Y 1.3.160.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle...
    --------------------------------------------------------------------------------
    [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.h2.Driver'
    roo> addon install id --searchResultId 1
    roo> Target resource(s):
    -------------------
    Spring Roo - Wrapping - h2 (1.3.161.0001)

    Optional resource(s):
    ---------------------
    slf4j-api (1.6.1)
    Servlet Specification API (2.5.0)
    slf4j-nop (1.6.1)

    Deploying...done.

    roo>
    If you look to the last lines, you will see that after 'Deploying...done' the message of 'Successfully installed add-on: Spring Roo - Wrapping' never is showned.

    If I try to launch:

    roo> database reverse engineer --package ~.domain --schema PUBLIC
    Located add-on that may offer this JDBC driver
    1 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
    ID T R DESCRIPTION -------------------------------------------------------------
    01 Y Y 1.3.160.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle...
    --------------------------------------------------------------------------------
    [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.h2.Driver'
    I see the same error one time and other...


    Any idea about why is happening this?

    Thank you.


    Edit: now it's working.

    Hi, i have test it again at my home PC, and now it's working.


    Edit: 01/13/2012 9.14 (GMT+1)

    it's so strange, i have the error at my work computer. The only one difference is that there is a proxy at our network. Maybe the installation of the JDBC drivers for H2 is failing because the proxy. Or maybe Roo is not able to connect to localhost in this network.
    Last edited by manuelcr; Jan 13th, 2012 at 02:16 AM. Reason: Same Error Again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •