Jan 11th, 2011, 05:46 PM
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.
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:
- Edited the database.properties file to the following:
NOTE: I have also tried, with the same result: database.driverClassName=oracle.jdbc.OracleDriver
Jan 12th, 2011, 12:12 AM
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.
Jan 12th, 2011, 12:12 AM
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:
<name>Sonatype OSGi Repo</name>
and add these dependencies:
<!-- Oracle dependencies -->
Then run 'mvn bundle:bundle', and then in Roo execute
> osgi install --url file:///C:/<project dir>/target/com.oracle.roo.jdbc.<...>.jar
Jan 13th, 2011, 01:08 PM
Help with the solution
I tried the proposed solutions but when I do MVN bundle:bundle
[ERROR] BUILD ERROR
[INFO] Failed to resolve artifact.
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.
from the specified remote repositories:
JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases),
Sonatype OSGi (http://osgi.sonatype.org/content/repositories/ss-external)
Jan 18th, 2011, 01:47 AM
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
Your help will be highly appreciated.
Jan 18th, 2011, 02:14 AM
i was able to generate a bundle using these repositories :
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
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...
Jan 18th, 2011, 02:23 AM
Thanks Ziler. Can you give me the steps how you did this?
Jan 18th, 2011, 02:42 AM
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
Jan 18th, 2011, 02:49 AM
Originally Posted by gowtamcs
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
Jan 18th, 2011, 10:47 AM
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
Tags for this Thread