Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: New Roo script for JDBC driver installation for DBRE

  1. #1
    Join Date
    Dec 2005
    Posts
    930

    Default New Roo script for JDBC driver installation for DBRE

    I have created a Roo script to install the OSGi JDBC drivers for use with DBRE which we don't ship because of their size. It will be part of the upcoming 1.1.0.RELEASE. To use, just type:

    Code:
    roo> script --file install-jdbc-drivers.roo
    And restart the shell. This is a one-time only installation.

    IMPORTANT: A small hiccup in the script may cause an issue: I used osgi install commands rather than osgi start commands. When the Roo shell is restarted, the bundles appear in the Resolved state, rather than Active. Though, on my system it does not appear to affect the operation of the drivers for DBRE. If this does cause an issue with your installations, one can run the script again with osgi start for each of the drivers - the commands will be in log.roo. This will be updated in 1.1.1.

    Alan
    Last edited by Alan Stewart; Oct 25th, 2010 at 06:26 PM.
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  2. #2
    Join Date
    Sep 2004
    Location
    Valencia, ES
    Posts
    92

    Default

    Great and useful!!

    Alan, do you have any doc that guides us to pack libs as OSGi bundles?

    I have observed the Spring guys do that easily ... any doc will be useful to pack 3rd party add-ons dependencies as bundles, for example CXF.

    Many thanks!!
    Enrique Ruiz
    DiSiD - http://www.disid.com

  3. #3
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    With a little luck dependencies required for your add-on are already in OSGi bundle format and in Maven Central in that form. This is the ideal world situation. The easiest way to check is to open the manifest and see if it contains import and export package etc entries typical to OSGi. Even if the entires are there, they're not necessarily correct, but at least you're off to a good start.

    In the frequent case a published JAR doesn't contain the required OSGi manifest, you'll need to "wrap" it. Take a look in Roo's "wrapping" directory for an example of how we wrap JARs. If you do wrap a JAR, you then need to publish the new wrapped JAR. Note the new wrapped JAR will have a package name unique to your project, such as as GroupID of com.foobar.myproject.wrapping.somelibrary and an ArtifactID of com.foobar.myproject.wrapping.somelibrary. This therefore offers uniqueness and you can publish the JAR to your own OBR repository. The new add-on creation commands automatically setup Google Code projects completed with your own OBR repository, so use that as a guide.

    Once your have your add-on and its dependencies in your own OBR repository, the final step is to make Roo aware of these so people can install your add-on. We have a magical email address, s2-roobot@vmware.com, which you simply email the URL to your OBR repository.xml file. RooBot indexes it and keeps an eye on it in the future for updates. It's that easy.

    As a general matter of principle it's good form to avoid your Roo add-on depending on bundles. Try to use the JDK and write utility classes etc. Adding a dependency is usually a lot of trouble and should be reserved for times you simply must have a dependency in the Roo OSGi-enabled shell classpath to do some useful work. For trivial cases, do without the dependency. Remember also all of these remarks apply only to the Roo OSGi shell. None of this is necessary if you're simply wanting to add a dependency to a Roo-created project. There's no OSGi involved in that case.

    I promise we'll document all this sometime soon. The good news is all the complex OSGi-related pieces ahve been figured out and baked into 1.1.0.RELEASE, so it's just a case of educating the community how to use it. We've been so flat out with completing GA we just ran out of time, but we'll address this promptly now.

    Cheers
    Ben
    Last edited by Ben Alex; Nov 8th, 2010 at 03:35 PM. Reason: fixed email address
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  4. #4
    Join Date
    Sep 2010
    Posts
    13

    Question

    This is failing due to the proxy server at my corporate location -- is there a way to configure Roo to deal with that proxy server?

  5. #5
    Join Date
    Oct 2010
    Posts
    4

    Default +1 proxy for install-jdbc-drivers.roo

    Just to +1 mnehrkorn, I can't work out to get roo running osgi installs through my authenicated proxy either.

    Thanks.

  6. #6
    Join Date
    Sep 2010
    Posts
    13

    Default Proxy workaround

    I was able to find a workaround to the problem....

    I just downloaded that zip file and then used a file URL to access it for the osgi install.

  7. #7
    Join Date
    Oct 2010
    Posts
    5

    Default

    Here is an example for HSQLDB.
    Download jar manually using url from the script.
    http://spring-roo-repository.springs....0.10.0001.jar

    Run install command in Roo shell.
    osgi install --url file:///d:/springsource/workspace/project/org.springframework.roo.wrapping.hsqldb-1.8.0.10.0001.jar

  8. #8
    Join Date
    Oct 2010
    Posts
    5

    Default

    Hi Alan
    Could you provide url to DB2 bundle?

  9. #9
    Join Date
    Dec 2005
    Posts
    930

    Default

    There is no url for DB2. As it is a licensed product we can't host the driver jars in any public repo. There does not appear to be any open source drivers for DB2 either .
    I haven't had any success yet in wrapping the jars either
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  10. #10
    Join Date
    Sep 2004
    Location
    Valencia, ES
    Posts
    92

    Default

    Thanks Ben,

    Absolutelly agree!

    Cheers
    Enrique Ruiz
    DiSiD - http://www.disid.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •