Added dependency disables plugin modules.

Daniel Micallef August 16, 2017

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 vote
Answer accepted
Aleksandr Zuevich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2017

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

Daniel Micallef August 16, 2017

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",
Daniel Micallef October 12, 2017

@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)?

Florian Pfeifer January 28, 2019

I'd like to know too

Jero Dungog December 13, 2019

I'd like to know too and also, who would I know what to put on the <Import-Package> tag?
is it the groupId value?

Like Armandt Fourie likes this
0 votes
Aleksandr Zuevich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2017

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.

Daniel Micallef August 16, 2017

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2017

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

Daniel Micallef August 16, 2017
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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2017

What is your JIRA version?

Daniel Micallef August 16, 2017

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 Sign up to answer