Roo reverse engineering on Oracle

This post is not really Bluebell oriented (by now), however I'm interested on sharing it.

As you know Oracle artifacts will not be maintained any more by Spring guys:

So we need to create an OSGI compliance artifact ourselves:

Find bellow steps to do it:

  1. Download the Oracle artifact you are interested in and materialize it as a Maven artifact. Following links may be interesting for you:
  2. Create a new folder in you preferred location and start roo on it.
  3. Install gpg and create a public key according to these links (note pgp must be on OS path):
  4. Then create the OSGI bundle with the following order:
    • addon create wrapper --topLevelPackage org.bluebell --projectName spring-roo-oracle-wrapper --artifactId ojdbc14 --groupId com.oracle --version classes12 --description "Oracle #jdbcdriver,driverclass:oracle.jdbc.OracleDriver" --licenseUrl "http://www.oracle.com/technetwork/licenses/distribution-license-152002.html" --vendorName "Oracle"
      
  5. This is not enough. Additional dependences are required. So edit the recently created pom and add the following repositories and dependencies:
    •  <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>
      
      ...
      <dependency>
      <groupId>javax.resource</groupId>
      <artifactId>com.springsource.javax.resource</artifactId>
      <version>1.5.0</version></dependency> 
      <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>com.springsource.javax.transaction</artifactId>
      <version>1.1.0</version>
      </dependency>
      
  6. Install the artifact (mvn install)
  7. Once done, a valid OSGI compliance Oracle driver will be available as Maven artifact into the local repository. In my case  additional (and optional) dependences were required, so the way I followed was to remove them directly from generated MANIFEST.MF file.
    Please note in such a case signing JAR will be useless

    They were:

    1. oracle.security.pki
    2. oracle.ons
    3. oracle.i18n.text.converter
  8. Install the osgi artifact in ROO: osgi start --url file:/my_jar_location.jar
    • osgi start --url file:/J:\.m2\repository\javax\resource\com.springsource.javax.resource\1.5.0\com.springsource.javax.resource-1.5.0.jar
      osgi start --url file:/J:\.m2\repository\javax\transaction\com.springsource.javax.transaction\1.1.0\com.springsource.javax.transaction-1.1.0.jar
      osgi start --url file:/J:\.m2\repository\com\oracle\org.bluebell.com.oracle.ojdbc14_g\10.2.0.1.0.0001\org.bluebell.com.oracle.ojdbc14_g-10.2.0.1.0.0001.jar
      

This worked for me, well... ...not at all:

Etiquetas

roo roo Borrar
oracle oracle Borrar
Introduzca las etiquetas para añadir a la página:
Please wait 
Truco: ¿Buscando una etiqueta? Empieza a escribir.
  1. feb 09, 2011

    Anónimo dice:

    thanks for all the notes & explanation. So, did it work finally? I am little...

    thanks for all the notes & explanation. So, did it work finally? I am little confused by the last line "This worked for me, well... ...not at all:

    1. feb 19, 2011

      Anónimo dice:

      This wrapping pom works for the 10.2.0.2 jar (for use on Oracle XE) <?xml v...

      This wrapping pom works for the 10.2.0.2 jar (for use on Oracle XE)

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>oracle</groupId>
          <artifactId>oracle.ojdbc14</artifactId>
          <packaging>bundle</packaging>
          <version>10.2.0.2.0001</version>
          <name>oracle</name>
          <description>This bundle wraps the standard Maven artifact: ${pkgArtifactId}-${pkgVersion}.</description>
          <properties>
              <pkgArtifactId>ojdbc14</pkgArtifactId>
              <pkgVersion>10.2.0.2</pkgVersion>
              <osgiVersion>${pkgVersion}.0001</osgiVersion>
              <pkgVendor>Oracle</pkgVendor>
              <pkgDocUrl/>
              <pkgLicense>http://www.oracle.com/technetwork/licenses/distribution-license-152002.html</pkgLicense>
          </properties>
      
          <dependencies>
              <dependency>
                  <groupId>oracle.jdbc.driver</groupId>
                  <artifactId>ojdbc14</artifactId>
                  <version>${pkgVersion}</version>
                  <optional>true</optional>
              </dependency>
          </dependencies>
      
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.felix</groupId>
                      <artifactId>maven-bundle-plugin</artifactId>
                      <version>2.3.4</version>
                      <extensions>true</extensions>
                      <configuration>
                          <instructions>
                              <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                              <Export-Package>*;version=${pom.version}</Export-Package>
                              <Bundle-Vendor>${pkgVendor} (wrapped into an OSGi bundle by the Spring Roo project build system)</Bundle-Vendor>
                              <Bundle-DocURL>${pkgDocUrl}</Bundle-DocURL>
                              <Bundle-License>${pkgLicense}</Bundle-License>
                              <Import-Package>oracle.i18n.*;resolution:=optional,oracle.ons.*;resolution:=optional,oracle.security.pki.*;resolution:=optional,*</Import-Package>
                          </instructions>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      
      </project>
      
    2. mar 14, 2011

      Julio Argüello Fernández dice:

      I apologize for the late response... The problem was ROO DBRE with Oracle hasn'...

      I apologize for the late response...

      The problem was ROO DBRE with Oracle hasn't discovered my DB foreign keys, it was reported without a definitive response:

      http://forum.springsource.org/showthread.php?p=341873#post341873

Saltar al final de la barra lateral Ir al inicio de la barra lateral