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

  • DBRE and DB2400

    I'm hoping Alan Stewart can help me here. I'm attempting DBRE on my DB2400 datasource. Alan you added support for DB2400 back in August when I showed you there was an open source JDBC driver for it. I hadn't had the chance to fully test DBRE on it before the M3 launch. Anyways, I'm trying it now and I keep getting a message saying the following:

    "No Spring Roo add-ons were found that offer a similar JDBC driver
    JDBC driver not available for com.ibm.as400.access.AS400JDBCDriver"

    Thanks in advance.

  • #2
    DB2/400 uses the JTOpen driver from memory? The jar was large (4.3Mb) and was is not shipped with Roo. If you build Roo from Git, do a mvn clean install in the wrapping directory first and then you can copy the jar from your mvn repo to the Roo bundle directrory for M3, or just use the Git code after doing the same mvn clean install from Roo root directory.
    Alan

    Comment


    • #3
      That's right, it does use JTOpen. I can understand that the jar is quite large, in probably 99.9% of any of my projects, it's always the biggest jar because IBM has packed in so much for the System i/AS400. It has grown in size even since I started using earlier versions.

      So given that the jar is too large to ship with Roo, what does that mean for the future of DBRE support for DB2400? Could the add-on be setup to scan the application dependencies for the available driver? That would be beneficial for DB2400 as well as for any other datasource that might use a proprietary JDBC driver that is not available open source. What do you think?
      Last edited by pgrimard; Sep 28th, 2010, 08:03 PM.

      Comment


      • #4
        It simply means Roo won't ship it, as we don't for other jars like Oracle and DB2, though these databases are available for DBRE. To test it, build the wrapping directory, then all of Roo.

        Comment


        • #5
          I built Roo M4 from source. First I tried merely copying the org.springframework.roo.wrapping.jtopen-6.7.0.0001.jar file to the M3 bundle directory and restarting the roo shell followed by the "database reverse engineer" command. That resulted in an IllegalArgumentException. So next I tried just doing the DBRE from Roo M4 that I just built and I got the same exception and the same message as before re "JDBC driver not available for com.ibm.as400.access.AS400JDBCDriver"


          test2 roo> database reverse engineer --schema patrick --package test2
          No Spring Roo add-ons were found that offer a similar JDBC driver
          JDBC driver not available for 'com.ibm.as400.access.AS400JDBCDriver'
          java.lang.IllegalArgumentException: JDBC driver not available for 'com.ibm.as400.access.AS400JDBCDriver'
          at org.springframework.roo.support.util.Assert.notNul l(Assert.java:112)
          at org.springframework.roo.addon.dbre.jdbc.Connection ProviderImpl.getConnection(ConnectionProviderImpl. java:41)
          at org.springframework.roo.addon.dbre.jdbc.Connection ProviderImpl.getConnection(ConnectionProviderImpl. java:53)
          at org.springframework.roo.addon.dbre.DbreModelServic eImpl.getConnection(DbreModelServiceImpl.java:285)
          at org.springframework.roo.addon.dbre.DbreModelServic eImpl.getDatabase(DbreModelServiceImpl.java:184)
          at org.springframework.roo.addon.dbre.DbreModelServic eImpl.refreshDatabase(DbreModelServiceImpl.java:13 7)
          at org.springframework.roo.addon.dbre.DbreOperationsI mpl.reverseEngineerDatabase(DbreOperationsImpl.jav a:79)
          at org.springframework.roo.addon.dbre.DbreCommands.se rializeDatabaseMetadata(DbreCommands.java:44)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.springframework.roo.support.util.ReflectionUti ls.invokeMethod(ReflectionUtils.java:191)
          at org.springframework.roo.process.manager.ProcessMan agerHostedExecutionStrategy$1.callback(ProcessMana gerHostedExecutionStrategy.java:49)
          at org.springframework.roo.process.manager.internal.D efaultProcessManager.doTransactionally(DefaultProc essManager.java:177)
          at org.springframework.roo.process.manager.internal.D efaultProcessManager.execute(DefaultProcessManager .java:140)
          at org.springframework.roo.process.manager.ProcessMan agerHostedExecutionStrategy.execute(ProcessManager HostedExecutionStrategy.java:47)
          at org.springframework.roo.shell.AbstractShell.execut eCommand(AbstractShell.java:159)
          at org.springframework.roo.shell.jline.JLineShell.pro mptLoop(JLineShell.java:324)
          at org.springframework.roo.shell.jline.JLineShell.run (JLineShell.java:117)
          at java.lang.Thread.run(Thread.java:637)

          Comment


          • #6
            It would appear then that there are missing dependencies. In the pom in the wrapping directory for jtopen, the Import-Package element in the build plugin needs to be modified. However, it will be a trial and error process.Perhaps the exclusion com.ibm.* is too much.
            This will require more investigation

            Comment


            • #7
              Is there anything I can do to assist you?

              Comment


              • #8
                Perhaps you can make changes to the pom.xml in the jtopen directory underneath the wrapping directory. Previously I was excluding com.ibm.* I changed this to
                Code:
                <Import-Package>com.ibm.sslight.*;resolution:=optional,com.ibm.gsk.*;resolution:=optional,com.ibm.cfwk.*;resolution:=optional,com.ibm.as400.ui.*;resolution:=optional,com.ibm.db2.jdbc.app.*;resolution:=optional,javax.servlet.*;resolution:=optional,sun.misc.*;resolution:=optional,*</Import-Package>
                However it still gives the same error. You could tweak these settings, by first removing com.ibm.sslight.* to see what errors result. The driver needs a minimum set of dependencies for it to work, and making com.ibm.* optional was too severe. Make sure your database.properties in the project has the correct connection parameters.
                Procedure is:
                1) make change in pom.xml of <roo dir>/wrapping/jtopen
                2) run mvn clean install in <roo dir>/wrapping/jtopen
                3) run mvn clean install in <roo dir>/addon-jdbc
                4) start roo with
                Code:
                rm -rf <roo dir>/bootstrap/target/osgi; roo-dev
                You will see errors in the dependencies in the startup. These can then be added to the Import-Package statement. Then repeat the process until no errors occur. The example above of com.ibm.sslight.* may need to be com.ibm.sslight.foo.* for example, but you will see this in the error message when Roo starts. Let me know if you don't understand what I have said or are having trouble.

                We're doing a release next week and I am flat out at the moment on other things, so would appreciate it.

                Would you also log a bug on this in Jira?
                Thanks
                Alan

                Comment


                • #9
                  Thanks Alan. I'm out of town this week working on a bunch of other projects, but I'll try all of this when I'm back at the end of next week. Will keep you posted. I'll also open that JIRA bug.

                  thanks.

                  Comment


                  • #10
                    JIRA bug opened ROO-1479

                    Comment


                    • #11
                      I believe I have resolved the issue, but will need you to test as I don't have access to a DB2/400 db as mentioned before. At least the driver is instantiated and not null

                      Alan

                      Comment


                      • #12
                        Well you're quicker than I was, lol.

                        It Worked!!! It is absolutely genius! It had no trouble determining the nearly 400 schemas in my database. I ran both introspect and dbre on my personal schema which doesn't have too many tables in it, and it all worked out just fine.

                        Truly an amazing tool! Btw, will you be in Chicago for SpringOne2GX?

                        Comment


                        • #13
                          That's great news it worked for you. The timing was excellent as well, as Ben and myself had committed a lot of performance enhancements a few days ago (ROO-1506) which made schemas with 400+ tables perform a lot better than before.

                          I can't make SpringOne unfortunately but Ben and Stefan will be there.
                          Alan

                          Comment


                          • #14
                            I had a regression bug as raised by myself in ROO-1528 that affects the referencedColumnName in the @JoinColumn annotation, so get the code and do a new build or wait for RC1.

                            Comment


                            • #15
                              I've just downloaded the 1.1.0-RELEASE version of Roo and it appears to still have this issue. I'm new to Roo, so there's a strong chance I'm doing something wrong, but I am getting the error message described originally in this thread. Here are the steps I've taken


                              roo> persistence setup --provider HIBERNATE --database DB2400

                              I have edited database.properties to fill in the hostname, username, and password.

                              I'm trying to introspect my library using the following:

                              roo> database introspect --schema MISKCB
                              No remote OBR repositories have matching add-ons matching your request
                              JDBC driver not available for 'com.ibm.as400.access.AS400JDBCDriver'


                              Anything I'm doing wrong?

                              Comment

                              Working...
                              X