Problems including ojdbc7 driver / lib with SDK 6.2.14 in custom plugin

Dear community, i’m rather new to atlassian and java-developement so i’m still struggeling not getting lost in documentations.

what to achieve:
We want to connect to an external database (oracle 12c) where we put plugin-data. The plugin should care about db-connection pooling and the relevant resources.

how got so far:
The test project was created with an older version of the sdk 5.x. We installed the ojdbc7.jar in the local maven repository

atlas-mvn install:install-file -Dfile=lib/ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc -Dversion=12.1.0.2.0 -Dpackaging=jar

and declared it as scope/compile in the pom.xml
To handle db-connection, exceptions and connection-pooling we us http://knowm.org/open-source/yank/. In order to get it running we also installed the yank.jar and it’s dependend hikari.jar locally like we did it with the ojdbc7.jar. Everything worked fine so far.

the problem:
In order to release the db-resources we’d like to implement the org.springframework.beans.factory.InitializingBean, DisposableBean and do DB-cleanups in the destroy() and afterPropertiesSet() methods.

help needed:
The SDK created the plugin as version 2 plugin which means we had to build a new plugin with the SDK 6.x in order to get all the spring relevant skeleton and declaration. Implementing the destroy() and afterPropertiesSet() seems to be working as supposed.
But now we seem to be unable to include the ojdbc7-driver as we did before - which means we are able to atlas-package but at runtime the plugin is disabled and won’t enable any more…we tried a bunch of alternative ways, but perhaps it all comes doen to…

[plugin.osgi.factory.OsgiPluginInstalledHelper] availableForTraversal Cannot determine required plugins, cannot resolve bundle

extract of the pom:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc</artifactId>
    <version>12.1.0.2.0</version>
    <scope>compile</scope>
</dependency>
...
<plugin>
      <groupId>com.atlassian.maven.plugins</groupId>
      <artifactId>maven-confluence-plugin</artifactId>
      <version>${amps.version}</version>
      <extensions>true</extensions>
      <configuration>
          <productVersion>${confluence.version}</productVersion>
          <productDataVersion>${confluence.data.version}</productDataVersion>
          <enableQuickReload>true</enableQuickReload>
          <enableFastdev>false</enableFastdev>
          <!-- To disable the extraction of dependencies -->
          <!-- <extractDependencies>false</extractDependencies> -->
          <!-- See here for an explanation of default instructions: -->
          <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
          <instructions>
              <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
              <!-- Add package to export here -->
              <Export-Package>at.ac.sbg.plugins.plusNavigation.api,</Export-Package>
              <!-- Add package import here -->
              <Import-Package>
                  org.springframework.osgi.*;resolution:="optional", 
                  org.eclipse.gemini.blueprint.*;resolution:="optional", 
                  oracle*;resolution:=optional,org.jaxen*;resolution:=optional,
                  *
              </Import-Package>
              <!-- Ensure plugin is spring powered -->
              <Spring-Context>*</Spring-Context>                        
          </instructions>
      </configuration>
  </plugin>

how to solve?
any hints ideas, alternative solutions…?

Thank you very much

I do pretty much the same with hibernate. My pom is lacking though the scope in the hibernate dependency. Try removing it, extract the jar after to confirm ojdbc is included and also check the manifest.mf

Hello Panos, thank you for the suggestion! Could not solve the problem for the lack of time, did a workaround consisting of manually dis/connect the database and ignore the spring/autowire-stuff…