Announcement Announcement Module
Collapse
No announcement yet.
jtds exception: next step? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jtds exception: next step?

    new to roo, so i'm hoping this is not the dumbest question ever...

    i am trying to set up roo for a Sybase SQLAnywhere database. roo uses jtds JDBC drivers, and i've hit a spot where jtds is throwing an ArrayIndexOutOfBoundsException:

    dbadmin.tess roo> database properties list
    database.driverClassName = net.sourceforge.jtds.jdbc.Driver
    database.password = password
    database.url = jdbc:jtds:sybase://localhost:2638/tess;TDS=4.2
    database.username = tess
    dbadmin.tess roo> database reverse engineer --package ~.domain --schema TESS
    ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method)

    i ran a quick test program outside of roo (a Class.forName and DriverManager.getConnection) and got the same exception, so it seems to me jtds is the culprit. i could try to debug it, but i'm a maven idiot and have no idea how i could get my patched jar into the roo project. i could also use the sybase jconnect drivers, but that doesn't seem to be something you can do in roo.

    so, any help on what i could/should try next is muchly appreciated.

  • #2
    Did you install the driver with the addon install id command? You would have been prompted to install the driver when issuing the database reverse engineer command and if you pushed TAB on the --schema option

    Comment


    • #3
      thanks. yes i did install the driver.

      Comment


      • #4
        What version of Roo are you using? Before installing the driver, run "development mode" and attempt to reverse engineer again, and post the stack trace here.

        Comment


        • #5
          Originally posted by grafpoo View Post
          new to roo, so i'm hoping this is not the dumbest question ever...

          i am trying to set up roo for a Sybase SQLAnywhere database. roo uses jtds JDBC drivers, and i've hit a spot where jtds is throwing an ArrayIndexOutOfBoundsException:

          dbadmin.tess roo> database properties list
          database.driverClassName = net.sourceforge.jtds.jdbc.Driver
          database.password = password
          database.url = jdbc:jtds:sybase://localhost:2638/tess;TDS=4.2
          database.username = tess
          dbadmin.tess roo> database reverse engineer --package ~.domain --schema TESS
          ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method)

          i ran a quick test program outside of roo (a Class.forName and DriverManager.getConnection) and got the same exception, so it seems to me jtds is the culprit. i could try to debug it, but i'm a maven idiot and have no idea how i could get my patched jar into the roo project. i could also use the sybase jconnect drivers, but that doesn't seem to be something you can do in roo.

          so, any help on what i could/should try next is muchly appreciated.
          Hey were you able to resolve this? I'm getting a null returned once development mode is turned on.

          roo> database reverse engineer --schema dbo --package ~.domain
          ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method)
          roo> development mode
          Development mode set to true
          roo> database reverse engineer --schema dbo --package ~.domain
          null

          Any help or advice would be greatly appreciated.

          Comment


          • #6
            To anyone trying to reverse engineer an SQL Anywhere database using Spring ROO. I just resolved this.

            A couple things need to be done.

            Roo's generated database properties file is no good. The additional 'TDS=4.2' on the end of the url causes the error I posted before. Removing that will no longer cause an ArrayIndexOutOfBoundsException. However that's not all, the jtds proposed driver can't do it. Use the Sybase jconnect driver. Add it using roo's osgi add -url command, and configure the database file to look something like this.

            database.driverClassName=com.sybase.jdbc3.jdbc.Syb Driver
            database.url=jdbc\:sybase\:Tds\:localhost\:2638

            The schema provided is also important, 'dbo' is no good. I found the schema needed to be the name of the owner of the tables in the database you are trying to intorspect/reverse engineer. To introspect the demo.db supplied with SQL Anywhere 12 I ran.

            database introspect --schema GROUPO

            GROUPO is the owner of the tables in the demo database.

            Hope this helps someone

            Comment

            Working...
            X