Announcement Announcement Module
Collapse
No announcement yet.
Deploying spring roo project onto the tc server in STS Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deploying spring roo project onto the tc server in STS

    Hi I am new to spring roo. I am using STS 2.9.2 and roo version 1.2.1.RELEASE. I created a roo project and tried to connect to a db2 database. I followed the steps mentioned in

    http://forum.springsource.org/showth...i+db2+database

    to get the osgi version of the db2jcc4.jar. I was able to connect and run database introspect --schema and also was able to run the database introspect --schema commands

    The problem is that when I deployed the project to the tc server which comes with STS I am getting the error

    ERROR org.hibernate.tool.hbm2ddl.SchemaValidator - could not get database metadata
    org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([ibm][db2][jcc][10333][11649] No license was found. An appropriate license file db2jcc_license_*.jar must be provided in the CLASSPATH setting.)

    Does this mean I need to get a osgi version of db2jcc_license_cu.jar? I tried the following
    1. Installed the jar into my local maven repository

    Code:
    mvn install:install-file -Dfile="C:\Program Files\IBM\SQLLIB_01\db2jcc_license_cu.jar" -DgroupId=com.ibm -DartifactId=db2jcc_license_cu -Dversion=10.1 -Dpackaging=jar -DgeneratePom=true

    2. I created the wraper project then ran the following to generate the pom.

    Code:
    addon create wrapper --topLevelPackage com.ibm.db2.roo.jdbc --groupId com.ibm --artifactId db2jcc_license_cu --version 10.1 --vendorName IBM --licenseUrl http://www-01.ibm.com/software/data/db2
    The generated pom is
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <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>com.ibm.db2.roo.jdbc</groupId>
        <artifactId>com.ibm.db2.roo.jdbc.db2jcc_license_cu</artifactId>
        <packaging>bundle</packaging>
        <version>10.1.0001</version>
        <name>com-ibm-db2-roo-jdbc</name>
        <description>This bundle wraps the standard Maven artifact: ${pkgArtifactId}-${pkgVersion}.</description>
        <properties>
            <pkgArtifactId>db2jcc_license_cu</pkgArtifactId>
            <pkgVersion>10.1</pkgVersion>
            <osgiVersion>${pkgVersion}.0001</osgiVersion>
            <pkgVendor>IBM</pkgVendor>
            <pkgDocUrl/>
            <pkgLicense>http://www-01.ibm.com/software/data/db2</pkgLicense>
            <repo.folder>com/ibm/db2/roo/jdbc</repo.folder>
            <google.code.project.name>${project.name}</google.code.project.name>
        </properties>
        <dependencies>
            <dependency>
                <groupId>com.ibm</groupId>
                <artifactId>db2jcc_license_cu</artifactId>
                <version>10.1</version>
                <optional>true</optional>
            </dependency>
        </dependencies>
        <scm>
            <connection>scm:svn:https://${google.code.project.name}.googlecode.com/svn/trunk</connection>
            <developerConnection>scm:svn:https://${google.code.project.name}.googlecode.com/svn/trunk</developerConnection>
            <url>http://code.google.com/p/${google.code.project.name}/source/browse</url>
        </scm>
        <distributionManagement>
            <repository>
                <id>Google Code</id>
                <url>dav:https://${google.code.project.name}.googlecode.com/svn/repo</url>
            </repository>
        </distributionManagement>
        <build>
            <extensions>
                <extension>
                    <groupId>org.apache.maven.wagon</groupId>
                    <artifactId>wagon-webdav-jackrabbit</artifactId>
                    <version>1.0-beta-6</version>
                </extension>
            </extensions>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.3</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.3.4</version>
                    <extensions>true</extensions>
                    <configuration>
                        <remoteOBR>true</remoteOBR>
                        <bundleUrl>httppgp://${google.code.project.name}.googlecode.com/svn/repo/${repo.folder}/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar</bundleUrl>
                        <instructions>
                            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                            <Export-Package>*;version=${project.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>COM.ibm.db2os390.*;resolution:=optional,com.ibm.websphere.*;resolution:=optional,javax.*;resolution:=optional,org.w3c.*;resolution:=optional,org.xml.*;resolution:=optional,sqlj.*;resolution:=optional,org.ietf.jgss;resolution:=optional,sun.*;resolution:=optional,com.ibm.zos.batch.*;resolution:=optional,org.osgi.framework.*;resolution:=optional</Import-Package>
                        </instructions>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>

    3. mvn bundle:bundle
    But at this step I get the following error

    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project com.ibm.db2.roo.jdbc.db2jcc_license_cu: Could not resolve dependencies for project com.ibm.db2.roo.jdbc:com.ibm.db2.roo.jdbc.db2jcc_l icense_cu:bundle:10.1.000
    1: Failure to find com.ibm:db2jcc_license_cu:jar:10.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central
    has elapsed or updates are forced -> [Help 1]

    Which leads me to believe the db2jcc_license_cu.jar is not found in my local repository, but I can see it. Any tips to debug this? Some documents I need to read?

    I believe all the jars used for the roo projects need to be osgi, is that right? Is there some specific steps needed to deploy roo projects that use osgi jars? Can someone point me in the right direction?

    Thanks
Working...
X