Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

A third party extension for Automation for Jira: BundleException

Irina Svirkina September 7, 2021

Hi all,

We develop a plugin for Jira Data Center (Git Plugin for Jira). We are developing own Automation for Jira  triggers and managed to implement them following the instructions. Our triggers work. Great.

But we want our plugin to stay enabled when Automation for Jira plugin is disabled. How to achieve it? Is it possible to register automation-rule-component dynamically?

<automation-rule-component.../>

 

Steps to reproduce

  • install Automation for Jira
  • install our plugin
  • Result: rules with our triggers can be created, actions are executed when it's required. Great
  • disable Automation for Jira

Actual result

  • our plugin is disabled also automatically
  • our plugin can't be installed/enabled. The next exception appears in logs
    2021-09-06 19:04:08,144+0600 http-nio-12990-exec-12 WARN admin 1144x39973x2 c20n8w 0:0:0:0:0:0:0:1 /rest/plugins/1.0/com.xiplink.jira.git.jira_git_plugin-key [c.a.plugin.impl.AbstractPlugin] Because of this exception
    com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.xiplink.jira.git.jira_git_plugin
    	at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:424)
    	at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:258)
    	at com.atlassian.plugin.manager.PluginEnabler.actualEnable(PluginEnabler.java:120)
    	at com.atlassian.plugin.manager.PluginEnabler.enable(PluginEnabler.java:97)
    	at com.atlassian.plugin.manager.PluginEnabler.enableAllRecursively(PluginEnabler.java:69)
    	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$enablePlugins$28(DefaultPluginManager.java:1572)
    	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
    	at com.atlassian.plugin.manager.DefaultPluginManager.enablePlugins(DefaultPluginManager.java:1539)
    	at com.atlassian.jira.plugin.JiraPluginManager.enablePlugins(JiraPluginManager.java:134)
    	... 3 filtered
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
    	at com.sun.proxy.$Proxy70.enablePlugins(Unknown Source)
    	... 3 filtered
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
    	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    
    ...
    
    
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: org.osgi.framework.BundleException: Unable to resolve com.xiplink.jira.git.jira_git_plugin [267](R 267.0): missing requirement [com.xiplink.jira.git.jira_git_plugin [267](R 267.0)] osgi.wiring.package; (osgi.wiring.package=com.codebarrel.automation.api.thirdparty) Unresolved requirements: [[com.xiplink.jira.git.jira_git_plugin [267](R 267.0)] osgi.wiring.package; (osgi.wiring.package=com.codebarrel.automation.api.thirdparty)]
    	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4149)
    	at org.apache.felix.framework.Felix.startBundle(Felix.java:2119)
    	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
    	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
    	at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:405)

Expected result

  • our plugin stays enabled or at least can be installed successfully when Automation for Jira is not installed

 

1 answer

1 accepted

0 votes
Answer accepted
Irina Svirkina September 9, 2021

I resolved the issue by removing this one

<component key="my-automation-trigger" name="My automation Trigger" 
class="com.my.MyTrigger"
interface = "com.codebarrel.automation.api.thirdparty.EventTriggerRuleComponent"
public
="true">

</component>

I left this one

<automation-rule-component key="my-trigger"
class="com.my.MyTrigger"
name="My trigger"
type="TRIGGER">
<param name="projectSafe">true</param>
</automation-rule-component>

----

Also the next dynamic import was configured in pom.xml for jira-maven-plugin

<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jira-maven-plugin</artifactId>
<version>8.0.0</version>
<configuration>
<instructions>
<DynamicImport-Package>
com.codebarrel.automation.api.thirdparty;version="3.0.2",
com.codebarrel.automation.api.thirdparty.context;version="3.0.2",
com.codebarrel.automation.api.thirdparty.context.result;version="3.0.2",
com.codebarrel.automation.api.config;version="3.0.2",
com.codebarrel.automation.api.thirdparty.smartvalues;version="3.0.2",
com.codebarrel.automation.api.thirdparty.audit;version="3.0.2",
com.codebarrel.automation.api.thirdparty.upgrade;version="3.0.2"
</DynamicImport-Package>
...
Yanshan March 4, 2025

how to develop 

<automation-rule-component.../>

i can not find document about this

 

this tag only have class attr,but no template or html.how can i add a config page? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events