Announcement Announcement Module
Collapse
No announcement yet.
DBRE - Null pointer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Location of files

    How do I retrieve the referenced files?

    Also would I want to substitute the Oracle 11g driver for the Spring Oracle 10 driver?

    Comment


    • #17
      Well think you got it right on classpath thing

      Now im past that error and have different cant get connection

      {code}
      roo> database properties list
      database.driverClassName = oracle.jdbc.OracleDriver
      database.password = xxx
      database.url = jdbc:oracle:thin:@dbserver.com:1521/xxxx
      database.username = xxx
      roo> database introspect --schema xxx
      Unable to get connection from driver
      {code}

      will com.springsource.oracle.jdbc-10.2.0.2.jar support oracle 11 driver?

      Comment


      • #18
        Your Oracle XE url must have 'XE' in it like this

        Code:
        database.url = jdbc:oracle:thin:@dbserver.com:1521:XE
        To use an 11g driver, you will have to check first if the supplied driver from Oracle is OSGi compatible. If not, you will have to create a wrapped jar with the driver in it. If you download Roo from Git, the "wrapping" directory has some examples.

        Comment


        • #19
          Ms-sql

          could you give a hint on what dependencies + bundled files are needed to reverse engineer a a MS-SQL Database ?

          with
          - JDTS
          - MSSQL JDBC

          Comment


          • #20
            Originally posted by Alan Stewart View Post
            My apologies as I have just realised that the oracle jar and its dependencies need to be in the Roo bundle directory. Please copy com.springsource.oracle.jdbc-10.2.0.2.jar, com.springsource.javax.transaction-1.1.0.jar, and com.springsource.javax.resource-1.5.0.jar to the Roo distribution's bundle directory. Restart Roo and you should be set to go.
            Thanks Alan. It works.

            Comment


            • #21
              After adding dependencies into pom.xml in your project, run 'mvn dependency:resolve' command. This will download all dependencies into your local Maven repository (by default ~/.m2/repository). Now copy files Alan listed from your local Maven repository into roo/bundle folder.

              Originally posted by peterg View Post
              How do I retrieve the referenced files?

              Also would I want to substitute the Oracle 11g driver for the Spring Oracle 10 driver?

              Comment


              • #22
                could you give a hint on what dependencies + bundled files are needed to reverse engineer a a MS-SQL Database ?

                with
                - MSSQL JDBC

                i really could use some help on this

                Comment


                • #23
                  MSSQL dbre introspect

                  Hello All...great forum.

                  I second the request for a helping spoon-feed for dbre-introspecting MSSQL. By the way, has anyone had success using the dbre addon over a jtds driver?

                  Since I'm new to maven (not Spring), I'm willing to suspect user error in my case in rediscovering the now well-known and dreaded result:

                  "No Spring Roo add-ons were found that offer a similar JDBC driver
                  JDBC driver not available for 'net.sourceforge.jtds.jdbc.Driver'"

                  However, after following (well, perhaps not) the documentation and forum posts, the process seems to result in the driver dependency somehow not being roped in properly.

                  It was mentioned that OSGI-enabled driver was necessary...is JTDS one such? I noticed the following in the roo M3 bundle

                  org.springframework.roo.wrapping.jtds-1.2.4.0001.jar

                  along with jtds-1.2.4.jar. The presence of these in the roo bundle seems indicative of *something* happening w/r/t the jdbc driver, but what specifically? These are in the roo bundle following the attempts to create a project, setup persistence provider and database properties (IIRC, I manually added jtds <dependency> since roo didn't seem to update pom.xml, etc.), and finally running 'dbre introspect --schema myschema'.

                  If there are takers, I can provide all necessary details but note that I'm using the roo M3 download (tried roo-dev M3, and roo M2 in sts 2.3.3.M2) and

                  mvn -version

                  Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
                  Java version: 1.6.0_20
                  Java home: /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre
                  Default locale: en_US, platform encoding: UTF-8
                  OS name: "linux" version: "2.6.27.42-0.1-xen" arch: "amd64" Family: "unix"


                  Thanks,
                  James

                  Originally posted by kostaroo View Post
                  could you give a hint on what dependencies + bundled files are needed to reverse engineer a a MS-SQL Database ?

                  with
                  - MSSQL JDBC

                  i really could use some help on this

                  Comment


                  • #24
                    The org.springframework.roo.wrapping.jtds-1.2.4.0001.jar is supplied by Roo and so it should work out of the box. Type osgi ps and you should see a line like this

                    Code:
                    [  68] [Active     ] [    1] Spring Roo - Wrapping - jtds (1.2.4.0001)
                    Last edited by Alan Stewart; Sep 1st, 2010, 07:54 PM.

                    Comment


                    • #25
                      Thanks very much for taking the time...

                      The 'osgi ps' output does show similar...

                      [ 66] [Active ] [ 1] Spring Roo - Wrapping - jtds (1.2.4.0001)

                      though I'm not sure what to make of the the following (if anything), since I'm using M3:

                      [ 68] [Active ] [ 1] Spring Roo - Shell (Eclipse Implementation) (1.1.0.M2)

                      I just downloaded STS 2.0.5.M3 (thanks!) and ran the following roo session, all in the IDE. It appears that I still haven't informed roo how to find the jdbc driver. Are there additional commands or manual machinations necessary to dbre introspect?

                      Regards,
                      James
                      ---------------------------

                      roo> persistence setup --provider HIBERNATE --database MSSQL
                      Managed SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml
                      Created SRC_MAIN_RESOURCES/META-INF/persistence.xml
                      Please enter your database details in src/main/resources/META-INF/spring/database.properties.
                      Created SRC_MAIN_RESOURCES/META-INF/spring/database.properties
                      Managed ROOT/pom.xml [Added dependency net.sourceforge.jtds:jtds:1.2.4]
                      ...[removed]
                      roo> database properties set --key database.driverClassName --value net.sourceforge.jtds.jdbc.Driver
                      Managed SRC_MAIN_RESOURCES/META-INF/spring/database.properties
                      roo> database properties set --key database.url --value jdbc:jtds:sqlserver://sqlserver:1433/dbName;useCursors=true
                      Managed SRC_MAIN_RESOURCES/META-INF/spring/database.properties
                      roo> database properties set --key database.username --value sa
                      Managed SRC_MAIN_RESOURCES/META-INF/spring/database.properties
                      roo> database properties set --key database.password --value sapass
                      Managed SRC_MAIN_RESOURCES/META-INF/spring/database.properties
                      roo> database introspect --schema dbo
                      No Spring Roo add-ons were found that offer a similar JDBC driver
                      JDBC driver not available for 'net.sourceforge.jtds.jdbc.Driver'

                      roo> osgi ps
                      START LEVEL 99
                      ID State Level Name
                      [ 0] [Active ] [ 0] System Bundle (2.0.4)
                      ...[removed]
                      [ 13] [Active ] [ 1] Spring Roo - Addon - Database Reverse Engineering
                      ...[removed]
                      [ 68] [Active ] [ 1] Spring Roo - Shell (Eclipse Implementation) (1.1.0.M2)

                      Comment


                      • #26
                        Do your unit tests and/or web app make a connection to your DB OK, with the properties in your database.properties? DBRE uses the same database.properties to make a connection to the live DB.

                        After jumping through all the hoops on the Microsoft site, my trial version of MS SQL 2008 is finally downloading now, so give me a couple of days to install this in a VM and to see if I can connect to it.

                        Alan

                        Comment


                        • #27
                          Unit test via 'perform tests' fails on a simple entity having one field (entity, controllers, scaffolding, all look good):

                          -------------------------------------------------------
                          T E S T S
                          -------------------------------------------------------
                          Running com.blah.FirstPassIntegrationTest
                          2010-09-02 22:07:53,064 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaValidator - could not get database metadata
                          org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'
                          ERROR org.hibernate.util.JDBCExceptionReporter - Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver'
                          Tests run: 9, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 2.992 sec <<< FAILURE!
                          Results :

                          Sorry about the SQL Server run-around and thanks for that. If, for some reason, it becomes too much of a distraction, let me know and I'll see if can get an open port and database for you to test against, temporarily.

                          - James

                          Comment


                          • #28
                            I was able to hook up to a Sybase server which uses the same jTDS driver and am having similar issues with unit tests and dbre, so I don't think it's a MSSQL specific issue. Will let you know

                            Comment


                            • #29
                              Solved

                              The following line in .../addon-jdbc/pom.xml:

                              <Import-Package>*,net.sourceforge.jtds.jdbc;resolution:=op tional,com.mysql.jdbc;resolution:=optional,org.apa che.derby.jdbc;resolution:=optional,oracle.jdbc;re solution:=optional,org.h2;resolution:=optional,org .hsqldb;resolution:=optional,org.postgresql;resolu tion:=optional</Import-Package>


                              ...must be changed to:

                              <Import-Package>*,net.sourceforge.jtds;resolution:=optiona l,com.mysql.jdbc;resolution:=optional,org.apache.d erby.jdbc;resolution:=optional,oracle.jdbc;resolut ion:=optional,org.h2;resolution:=optional,org.hsql db;resolution:=optional,org.postgresql;resolution: =optional</Import-Package>


                              Basically, we were referring to 'net.sourceforge.jtds' instead of 'net.sourceforge.jtds.jdbc'

                              I hope this helps.

                              -Mdu

                              Comment


                              • #30
                                Did you mean that it has to be changed to <Import-Package>*,net.sourceforge.jtds.jdbc ....?

                                Comment

                                Working...
                                X