Announcement Announcement Module
Collapse
No announcement yet.
Problem getting started with DBRE Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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>

      Comment


      • #4
        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

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment


            • #7
              sorry, duplicate

              Comment


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

                Comment


                • #9
                  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>

                  Comment


                  • #10
                    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, 03:16 AM. Reason: Same Error Again

                    Comment


                    • #11
                      Hi,

                      I too am currently trying the examples in "Getting started with Roo" and face the exact same problem as manuelcr above.

                      So far, I've tried STS 3.0.0 and 3.1.0 - Windows 7, 64 Bit, JDK1.6.0_35 - and have even deleted the workspace repeatedly, just to make sure. I am not sitting behind a proxy.

                      Any idea how I could narrow down the cause of the problem?

                      Thanks!

                      Comment


                      • #12
                        I also had this problem in which I found that if you download the driver manually and use the OSGI command to point to your driver file. osgi start --url file:///c:/path/to/your/driver.jar
                        It worked for me when using mysql with the same issue.

                        Comment


                        • #13
                          Thanks for the reply.
                          The workaround that worked for me (and apparently manuelcr) is to use the Roo shell directly -- not the one integrated in STS.

                          However, I would very much like to use STS's integrated Roo shell, so I wanted to know how to determine (narrow down) the cause of the problem.
                          Anyone out there knows how?

                          Comment


                          • #14
                            Still exactly the same Problem in Version 3.1.0.RELEASE.

                            Also trying the examples in "Getting started with Roo", likewise behind a proxy and within the STS.

                            Comment

                            Working...
                            X