Added dependency disables plugin modules.

I added MongoDB driver dependency to pom.xml and installed plugin, all plugin modules became disabled.

 

The following is the added dependency to pom.xml

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.4.2</version>
</dependency>

 

2 answers

1 accepted

1 votes
Aleksandr Zuevich Community Champion Aug 16, 2017

Do you have <Import-Package> in your pom.xml?

Added the following packages to <Import-Package> and all modules are now enabled! @Aleksandr Zuevich Thank you for your help!

org.bson.*;resolution:="optional", 
com.mongodb.*;resolution:="optional",

@Aleksandr Zuevich reopening this question; why is it that with a particular dependency (as per above) we must limit the <scope> to provided and add the above Import Packages (whilst this is not needed with other dependencies)?

0 votes

Hi Daniel,

set provided scope to this dependency <scope>provided</scope>.

I suppose the reason is bundled jira-monitoring-plugin already has mongo-java-driver as a dependency. When you don't set the scope explicitly the scope has compile value by default. So you have a conflict here.

Hi Aleksandr, Thank you for your quick response. Unfortunately modules are still disabled via the following: 

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.4.2</version>
<scope>provided</scope>
</dependency>

For some reason simply removing the dependency enables all plugins to function as required, however I need this to connect to MongoDB instance.

Aleksandr Zuevich Community Champion Aug 16, 2017

What errors do you have in the atlassian-jira.log?

371507:2017-08-16 15:55:47,342 UpmAsynchronousTaskManager:thread-2 ERROR danielm 549x2426974x3 eusx1n 192.168.212.161,192.168.202.165 /rest/plugins/1.0/available/featured [c.a.p.osgi.factory.OsgiPluginInstalledHelper] Cannot determine required plugins, cannot resolve bundle 'com.rs2.jira.plugin.customfield.dynamic-table-for-jira'
371832:2017-08-16 15:55:47,345 UpmAsynchronousTaskManager:thread-2 ERROR danielm 549x2426974x3 eusx1n 192.168.212.161,192.168.202.165 /rest/plugins/1.0/available/featured [c.a.p.osgi.factory.OsgiPlugin] Detected an error (BundleException) enabling the plugin 'com.rs2.jira.plugin.customfield.dynamic-table-for-jira' : Unresolved constraint in bundle com.rs2.jira.plugin.customfield.dynamic-table-for-jira [354]: Unable to resolve 354.0: missing requirement [354.0] osgi.wiring.package; (osgi.wiring.package=com.mongodb). This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN
372697:2017-08-16 15:55:47,345 UpmAsynchronousTaskManager:thread-2 WARN danielm 549x2426974x3 eusx1n 192.168.212.161,192.168.202.165 /rest/plugins/1.0/available/featured [c.a.plugin.impl.AbstractPlugin] Unable to enable plugin 'com.rs2.jira.plugin.customfield.dynamic-table-for-jira'
372974-2017-08-16 15:55:47,345 UpmAsynchronousTaskManager:thread-2 WARN danielm 549x2426974x3 eusx1n 192.168.212.161,192.168.202.165 /rest/plugins/1.0/available/featured [c.a.plugin.impl.AbstractPlugin] Because of this exception
373196:com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.rs2.jira.plugin.customfield.dynamic-table-for-jira
373332- at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:418)
373417- at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:287)
373494- at com.atlassian.plugin.manager.PluginEnabler.actualEnable(PluginEnabler.java:130)
373578- at com.atlassian.plugin.manager.PluginEnabler.enable(PluginEnabler.java:107)
373656- at com.atlassian.plugin.manager.DefaultPluginManager.enableDependentPlugins(DefaultPluginManager.java:1245)
373765- at com.atlassian.plugin.manager.DefaultPluginManager.addPlugins(DefaultPluginManager.java:1215)
373862- at com.atlassian.jira.plugin.JiraPluginManager.addPlugins(JiraPluginManager.java:152)
373949- at com.atlassian.plugin.manager.DefaultPluginManager.scanForNewPlugins(DefaultPluginManager.java:927)
374052- at com.atlassian.plugin.manager.DefaultPluginManager.installPlugins(DefaultPluginManager.java:845)
374152- at com.atlassian.jira.plugin.JiraPluginManager.installPlugins(JiraPluginManager.java:170)
--
380473- at com.atlassian.upm.core.rest.resources.install.InstallFromFileTask.executeTask(InstallFromFileTask.java:37)
380584- at com.atlassian.upm.core.rest.resources.install.InstallTask.run(InstallTask.java:81)
380671- at com.atlassian.upm.core.async.AsynchronousTaskManager.executeTask(AsynchronousTaskManager.java:124)
380774- at com.atlassian.upm.core.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:102)
380872- at com.atlassian.upm.core.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:99)
380969- at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38)
381075- at java.util.concurrent.FutureTask.run(FutureTask.java:266)
381136- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
381220- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
381304- at java.lang.Thread.run(Thread.java:745)
381346:Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.rs2.jira.plugin.customfield.dynamic-table-for-jira [354]: Unable to resolve 354.0: missing requirement [354.0] osgi.wiring.package; (osgi.wiring.package=com.mongodb)

The above is the log found (note that I grepped the best parts I could). The problem seems to be that the version of my dependency is not supported by the JIRA sdk version.

Aleksandr Zuevich Community Champion Aug 16, 2017

What is your JIRA version?

Version 7.3.5

The log links to this page, however I am still unsure of how to make the Mongo driver available.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,815 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot