Announcement Announcement Module
Collapse
No announcement yet.
ROO 1.1.1 Oracle JDBC issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ROO 1.1.1 Oracle JDBC issue

    I've been having issues trying to get Roo to recognize the ojdbc14.jar (version 10.2.0.5.0) installed in my local Maven repository. I have followed the steps in the documentation for configuring Roo to use the Oracle JDBC jar file, but I am still getting the 'addon search --requiresDescription "#jdbcdriver,driverclass:oracle.jdbc.driver.Oracle Driver" found no matches' message when executing the call:

    database reverse engineer --schema my_schema_name

    That would seem to indicate that Roo cannot find the jar file. However, Maven does appear to be configured properly, and the SpringSource Tool Suite app does find the ojdbc library in it's classpath through Maven. It just seems to be Roo that is not able to find the jar.

    From what I have been reading, I am thinking this may have something to do with the addon create wrapper functionality in Roo, but that may be a red herring, I just can't tell.

    TECHNICAL DETAILS:

    All Roo/Maven/STS code comes from the new springsource-tool-suite-2.5.2 download off the Spring website.

    I have performed the following steps to get the ojdbc jar installed in my local repository:

    - run the command mvn install:install-file -Dfile=C:/Users/jason.ross/Downloads/ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.5.0 -Dpackaging=jar -DgeneratePom=true

    - Updated the ojdbc tag created by Roo (when executing persistence setup --provider HIBERNATE --database ORACLE) in the project pom.xml to:

    <dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.5.0</version>
    </dependency>


    - Edited the database.properties file to the following:

    database.password=***
    database.url=jdbc:oracle:thin:@localhost:1524:dev
    database.username=schema_owner
    database.driverClassName=oracle.jdbc.driver.Oracle Driver


    NOTE: I have also tried, with the same result: database.driverClassName=oracle.jdbc.OracleDriver

  • #2
    The Oracle dependency in your pom is for your own user-project - the Roo shell does not use this. DBRE only uses what's in your database.properties file to make a connection.

    The problem is that Oracle is a licensed product and we cannot provide their jars in the Roo distribution, nor can we host their jars in any of our repositories. Moreover, Roo needs OSGi-enabled jars and I don't believe Oracle ships OSGi-enabled jars that can run in an OSGi container like the one that the Roo shell runs in.

    We are looking at our licensing arrangement with Oracle to be able to provide Roo users with Oracle OSGi driver jars and I will keep you informed of the progress in this forum.

    At the moment you will have to wrap your own Oracle driver jars. Their are examples in the wrapping directory of the Roo source code in Git.

    Alan

    Comment


    • #3
      It seems that the 'addon wrapper' creation is required for Roo to be able to use Oracle for database reverse engineering. After you have installed Oracle JDBC into your local repository, create another project, run Roo, execute the 'addon create wrapper' command (something like this will do:

      > addon create wrapper --topLevelPackage com.oracle.roo.JDBC --groupId com.oracle --artifactId ojdbc14 --version 10.2.0.2 --vendorName Oracle --licenseUrl http://www.oracle.com

      ).

      Then add these repositories to the generated POM:

      <repositories>
      <repository>
      <id>JBoss Repo</id>
      <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
      <name>JBoss Repo</name>
      </repository>
      <repository>
      <id>Sonatype OSGi</id>
      <url>http://osgi.sonatype.org/content/repositories/ss-external</url>
      <name>Sonatype OSGi Repo</name>
      </repository>
      </repositories>

      and add these dependencies:

      <!-- Oracle dependencies -->
      <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>


      Then run 'mvn bundle:bundle', and then in Roo execute

      > osgi install --url file:///C:/<project dir>/target/com.oracle.roo.jdbc.<...>.jar

      HTH

      Comment


      • #4
        Help with the solution

        I tried the proposed solutions but when I do MVN bundle:bundle
        I get:


        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] Failed to resolve artifact.

        Missing:
        ----------
        1) com.oracle.jdbc:com.springsource.oracle.jdbc:jar:1 0.2.0.2

        Try downloading the file manually from the project website.

        Then, install it using the command:
        mvn install:install-file -DgroupId=com.oracle.jdbc -DartifactId=com.springsource.oracl
        e.jdbc -Dversion=10.2.0.2 -Dpackaging=jar -Dfile=/path/to/file

        Alternatively, if you host your own repository you can deploy the file there:
        mvn deploy:deploy-file -DgroupId=com.oracle.jdbc -DartifactId=com.springsource.oracle.
        jdbc -Dversion=10.2.0.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


        Path to dependency:
        1) com.oracle.roo.jdbc:com.oracle.roo.jdbc.ojdbc14:bu ndle:10.2.0.2.0001
        2) com.oracle.jdbc:com.springsource.oracle.jdbc:jar:1 0.2.0.2

        ----------
        1 required artifact is missing.

        for artifact:
        com.oracle.roo.jdbc:com.oracle.roo.jdbc.ojdbc14:bu ndle:10.2.0.2.0001

        from the specified remote repositories:
        central (http://repo1.maven.org/maven2),
        JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases),
        Sonatype OSGi (http://osgi.sonatype.org/content/repositories/ss-external)

        Comment


        • #5
          Hello Guys, did the solution work? I am working with Roo version 1.1 and am unable to add jdbc drivers. I keep getting the error below

          osgi install --url http://repository.springsource.com/m...c-10.2.0.2.jar
          java.io.FileNotFoundException: http://repository.springsource.com/m...c-10.2.0.2.jar

          Your help will be highly appreciated.

          Thanks,

          Gowtam

          Comment


          • #6
            Hello,

            i was able to generate a bundle using these repositories :

            <repositories>
            <repository>
            <id>com.springsource.repository.bundles.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/release</url>
            </repository>
            <repository>
            <id>com.springsource.repository.bundles.external </id>
            <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/external</url>
            </repository>
            </repositories>


            but after that, the bundle didn't works in Spring Roo because it's linked (in import section of MANIFEST.MF) with too much bundles wich didn't exists (oracle.ons for example)

            that's why i think that the generation of an oracle jdbc driver bundle is a little more complicated...

            ps : if you have an installed version of Spring Roo 1.1.0 you can grab a working osgi bundle for Oracle. That's what i finally did...

            regards

            Comment


            • #7
              Thanks Ziler. Can you give me the steps how you did this?

              Thanks,

              Gowtam

              Comment


              • #8
                You need to wrap the Oracle driver jar as well as the javax.resource and javax.transaction jars, as we can't host them any more

                Comment


                • #9
                  Originally posted by gowtamcs View Post
                  Thanks Ziler. Can you give me the steps how you did this?

                  Thanks,

                  Gowtam
                  Hello,

                  in Spring Roo 1.1.0, perform "osgi ps" to identify existing bundles for Oracle : javax transaction, javax resource and oracle jdbc driver

                  in the directory cache, you will find corresponding jar
                  copy and rename these jar : com.springsource.javax.resource-1.5.0.jar, com.springsource.javax.transaction-1.1.0.jar and com.springsource.oracle.jdbc-10.2.0.2.jar

                  then install these jars in Spring Roo 1.1.1

                  osgi install --url file:///D:/dev/java/tests/spring-roo-1-1-1/oracle/com.springsource.javax.resource-1.5.0.jar
                  osgi install --url file:///D:/dev/java/tests/spring-roo-1-1-1/oracle/com.springsource.javax.transaction-1.1.0.jar
                  osgi install --url file:///D:/dev/java/tests/spring-roo-1-1-1/oracle/com.springsource.oracle.jdbc-10.2.0.2.jar

                  regards

                  Comment


                  • #10
                    Got it working

                    This is what I did to get aroudn my problem, although this is probably not the proper way to install the jdbc driver:

                    osgi install --url file:///C:/.m2/repository/com/oracle/ojdbc14/10.2.0.2.0/ojdbc14-10.2.0.2.0.jar

                    Comment


                    • #11
                      With oracle driver 10.2.0.1.0 also oracle.security.pki is required...

                      Comment


                      • #12
                        I reply myself:
                        http://saber.b2b2000.com/display/BLU...ring+on+Oracle

                        Comment


                        • #13
                          Originally posted by ziller View Post
                          Hello,

                          in Spring Roo 1.1.0, perform "osgi ps" to identify existing bundles for Oracle : javax transaction, javax resource and oracle jdbc driver

                          in the directory cache, you will find corresponding jar
                          copy and rename these jar : com.springsource.javax.resource-1.5.0.jar, com.springsource.javax.transaction-1.1.0.jar and com.springsource.oracle.jdbc-10.2.0.2.jar
                          I tried the same to use Roo 1.1.0, but when I typed "osgi ps" command, I could not find the required jars in the list. The closest i could see is "[ 19] [Active ] [ 1] Spring Roo - Addon - JDBC Driver Acquisition (1.1.0.RELEASE)"

                          Comment


                          • #14
                            it only works if you had installer oracle drivers in 1.1.0

                            regards

                            Comment


                            • #15
                              Just to clear up any confusion, between Roo 1.1.0 and 1.1.1, we now can't host any Oracle jars due to licensing restrictions. We are trying to get OSGi-wrapped drivers for Oracle produced and hosted but it is currently in the lawyer's hands.
                              Alan

                              Comment

                              Working...
                              X