Announcement Announcement Module
Collapse
No announcement yet.
Troubles introspecting an Oracle DB Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Troubles introspecting an Oracle DB

    Hi,

    I'm having troubles introspecting an Oracle DB. I'm new to Roo, so it probably is something I'm doing wrong. I'm getting the error:

    "No Spring Roo add-ons were found that offer a similar JDBC driver
    JDBC driver not available for 'oracle.jdbcOracleDriver'"

    I'm using the Roo command:

    Code:
    database introspect --schema dev_pbb
    My database properties are:

    Code:
    database.driverClassName = oracle.jdbc.OracleDriver
    database.password = ******
    database.url = jdbc:oracle:thin:@dpdb003:1521:dev_pbb
    database.username = eo_npn
    I am using 1.1.0.M4. I also tried 1.1.0.M3, and tried 1.1.0.M4 at the suggestion of a bug listed in JIRA. (https://jira.springframework.org/browse/ROO-1354)

    I've loaded two Oracle drivers into my maven 2 repository using the following commands:

    Code:
    mvn install:install-file -Dfile="C:\Oracle JDBC\ojdbc6.jar" -DgroupId=com.oracle -DartifactId=oracle -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=true
    mvn install:install-file -Dfile="C:\Oracle JDBC\ojdbc14.jar" -DgroupId=com.oracle -DartifactId=oracle -Dversion=10.2.0.4 -Dpackaging=jar -DgeneratePom=true
    Is there an easy way to test if Roo can see the JDBC drivers at all? Is there something else I need to do first? Any ideas on how to proceed?

    Thanks,

    DJ Spiess

  • #2
    Please have a read of this forum entry first - http://forum.springsource.org/showth...ht=Oracle+dbre

    Alan

    Comment


    • #3
      OK... I assume the part of that thread I'm supposed to be looking at is post #3??

      I'm guessing the steps I need to do to get Oracle to work is

      1) Get the 10.2.0.2 OSGi Oracle driver from the Spring EBR
      2) Update the Roo distribution's bundle directory with the xml changes listed

      So that brings up the following questions:

      1) Where do I find the Spring EBR?
      2) What file am I editing to add the XML changes? What is the "Roo distribution's bundle directory"?

      Thanks,
      DJ Spiess

      Comment


      • #4
        If you're using 1.1.0.M4 of Roo, you must have built it from source from the Git repository as M4 has not been released. The required dependencies would have been downloaded when you did the mvn clean install. See below - these dependencies are in the addon-jdbc/pom.xml

        Code:
        		<dependency>
        			<groupId>com.oracle.jdbc</groupId>
        			<artifactId>com.springsource.oracle.jdbc</artifactId>
        			<version>10.2.0.2</version>
        		</dependency>
        		<dependency>
        			<groupId>javax.resource</groupId>
        			<artifactId>com.springsource.javax.resource</artifactId>
        			<version>1.5.0</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>javax.transaction</groupId>
        			<artifactId>com.springsource.javax.transaction</artifactId>
        			<version>1.1.0</version>
        			<scope>provided</scope>
        		</dependency>
        Can you check they are in your maven repo? Inside Roo, execute the command "osgi ps" and if the Oracle bundles are active, you will see
        Code:
        [   3] [Active     ] [    1] Oracle JDBC Driver (10.2.0.2)
        (The first number may be different).
        What versiion of Oracle do you use? We can only provide OSGi-bundled drivers for Oracle XE 10.2.0.2 as Oracle is a licensed product.
        Alan


        Alan
        Last edited by Alan Stewart; Oct 5th, 2010, 04:18 PM.

        Comment


        • #5
          Yes I did rebuild M4 from git because there was a JIRA item saying introspection was broken in M3.

          I verified that the XML you listed is in addon-jdbc/pom.xml.

          Running the roo command, I could not find anything Oracle listed.

          I am trying to connect to an Oracle instance version 11.2.0.1. So are you saying that only 10.2.0.2 is the only supported version, or do I need to add something to use this version?

          Thanks,
          DJ Spiess

          Comment


          • #6
            Oracle XE 10.2.0.2 is the only version we can provide OSGi bundled drivers for. Oracle 11g or any version will work for your Roo-generated projects, but Roo itself requires all jars to be OSGi enabled.

            If you have the 11g jar(s), you can use the wrapping facility in Roo to wrap them. Take a look at one of the examples already there, like wrapping\mysql\pom.xml. It is a bit involved, but if you have any questions let me know. The drivers for open source databases like PostGreSQL, MySQL, H2, etc either already provide OSGI-bundled drivers or are easily obtained and wrapped, but since Oracle and DB2 are licensed products, we can't do this ourselves.

            Is there anyway first you can test against Oracle XE? I would like to make sure there are no other issues. The fact that you didn't see the Oracle bundle with the osgi ps command suggests there is a problem. Once verified, the 11g jars can be wrapped.

            Alan

            Comment


            • #7
              OK, I installed Oracle XE and tested it with a simple table. I still get the error so there must be some other problem. What else can I check?

              As for the wrapping, is there a step-by-step guide on how to wrap the 11g jars?

              Thanks!

              Comment


              • #8
                Are you able to run unit tests and/or a web app with your Oracle XE app?

                Please backup your project with the Roo backup command and send it to me at stewarta at vmware dot com, along with the Oracle schema. I think this will be the quickest way to resolve the issue
                Thanks
                Alan

                Comment


                • #9
                  Please look at my remark in another "Roo" thread concerning Oracle. OTN developer license states, that Oracle products are free for download and use for prototyping, evanluating purposes. Please read the document at OTN. Since Java+Oracle is the most often infrastructure for the enterprise, I feel Springsource should focus little bit more on eliminating the small startup problems concerning this infrastructure.

                  Comment

                  Working...
                  X