Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,466,623
Community Members
 
Community Events
176
Community Groups

A third party extension for Automation for Jira: BundleException

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

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>
...

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events