Issues Deploying Add-On with Tomcat JDBC Library

We’re trying to deploy an add-on using the Tomcat JDBC library to manage pooled connections to a Postgres instance. It all compiles fine, but when we try to deploy it, we run into the following error:

Unable to resolve 174.0: missing requirement [174.0] osgi.wiring.package; (osgi.wiring.package=org.osgi.service.jdbc)

So far, adding in any libraries that contain the org.osgi.service.jdbc package in JIRA’s lib directory seems to do nothing, while that works for other dependencies that hadn’t yet been satisfied.

Is there a more recommended way of doing connection pooling from within a JIRA add-on to an external database? Are we perhaps packaging the add-on incorrectly? Let me what additional information you might need.

I’m guessing it’s a conflict with Osgi (because of the osgi jdbc package name). If you’re importing an osgi service - make sure it’s declared somewhere (even if it’s your own add-on).

I’m going to assume that you’re using SpringScanner (i.e. you don’t have the component-import’s in your atlassian-plugin.xml). If you’re annotating a service with @ComponentImport - then Jira needs to be able to find that service somewhere. If you’re instantiating that within your add-on you can just get rid of the @ComponentImport (just declare your instance of the Service with @Component). That way Jira won’t go and ask for the Service from OSGi.