Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-3356

unable to define custom LinkProvider in plugin - ClassNotFoundException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 5.6.9
    • 5.7
    • None
    • JIRA v4.4-rc1#646-r155321, GreenHopper bundled with JIRA (5.7-rc2)

    Description

      I am developing a GreenHopper plugin. I tried migrating an existing GH 5.6 plugin to 5.7 but it fails to load a gh-link-provider module (http://confluence.atlassian.com/display/GH/GreenHopper+LinkProvider+Plugin+Documentation).

      atlassian-plugin.xml:

      	<gh-link-provider key="spghi-issue-menu-item" name="Agile Cards GreenHopper Integration issue menu item"
      			class="com.spartez.scrumprint.integration.GreenHopperMenuItems"/>
      

      the class:

      public class GreenHopperMenuItems implements LinkProvider {
      ...
      

      java.lang.ClassNotFoundException: com.atlassian.greenhopper.plugin.link.LinkProvider is thrown on plugin installation via UPM or Atlassian Plugin SDK pi command.

      The cause: package com.atlassian.greenhopper.plugin.link is no longer exported via OSGi in META-INF/MANIFEST.MF in transformed JAR.

      Private-Package: com.atlassian.greenhopper,com.atlassian.greenhopper.a
      ...
       odel.validation,>>>com.atlassian.greenhopper.plugin.link<<<,com.atlassian.g
      ...
      

      This prevents ANY GreenHopper plugin from working that's using gh-link-provider.
      Please export back com.atlassian.greenhopper package and its subpackages.

      The problem does not exist in GreenHopper 5.6.7 where the package is exported:

      Export-Package: com.pyxis.greenhopper.jira.fields;uses:="com.atlassian
      ...
       e.backlog,>>>com.atlassian.greenhopper.plugin.link<<<,org.ofbiz.core.entity
      ...
      

      logs/catalina.out:

      2011-07-04 13:02:19,678 pool-2-thread-2 ERROR admin 782x184x1 w1i2kb 0:0:0:0:0:0:0:1 /rest/plugins/1.0/ [atlassian.plugin.manager.DefaultPluginManager] There was an error loading the descriptor 'Agile Cards GreenHopper Integration issue menu item' of plugin 'com.spartez.scrumprint.greenhopper-integration'. Disabling.
      com.atlassian.plugin.PluginParseException: Error retrieving dependency of class: com.spartez.scrumprint.integration.GreenHopperMenuItems. Missing class: com/atlassian/greenhopper/plugin/link/LinkProvider
              at com.atlassian.plugin.module.LegacyModuleFactory.getModuleClass(LegacyModuleFactory.java:50)
              at com.atlassian.plugin.descriptors.AbstractModuleDescriptor.loadClass(AbstractModuleDescriptor.java:175)
              at com.atlassian.plugin.descriptors.AbstractModuleDescriptor.enabled(AbstractModuleDescriptor.java:436)
              at com.atlassian.jira.plugin.JiraResourcedModuleDescriptor.enabled(JiraResourcedModuleDescriptor.java:239)
              at com.atlassian.greenhopper.plugin.link.LinkProviderModuleDescriptor.enabled(LinkProviderModuleDescriptor.java:29)
              at com.atlassian.plugin.manager.DefaultPluginManager.notifyModuleEnabled(DefaultPluginManager.java:1420)
              at com.atlassian.plugin.manager.DefaultPluginManager.enableConfiguredPluginModule(DefaultPluginManager.java:1227)
              at com.atlassian.plugin.manager.DefaultPluginManager.enableConfiguredPluginModules(DefaultPluginManager.java:1193)
              at com.atlassian.plugin.manager.DefaultPluginManager.addPlugins(DefaultPluginManager.java:690)
              at com.atlassian.plugin.manager.DefaultPluginManager.scanForNewPlugins(DefaultPluginManager.java:414)
              at com.atlassian.plugin.manager.DefaultPluginManager.installPlugins(DefaultPluginManager.java:317)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
              at $Proxy482.installPlugins(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
              at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
              at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
              at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy771.installPlugins(Unknown Source)
              at com.atlassian.upm.PluginAccessorAndControllerImpl$1.doInTransaction(PluginAccessorAndControllerImpl.java:84)
              at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25)
              at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:34)
              at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.atlassian.multitenant.impl.MultiTenantComponentFactoryImpl$AbstractMultiTenantAwareInvocationHandler.invokeInternal(MultiTenantComponentFactoryImpl.java:181)
              at com.atlassian.multitenant.impl.MultiTenantComponentFactoryImpl$MultiTenantAwareInvocationHandler.invoke(MultiTenantComponentFactoryImpl.java:211)
              at $Proxy274.doInTransaction(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
              at $Proxy274.doInTransaction(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor244.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154)
              at $Proxy274.doInTransaction(Unknown Source)
              at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21)
              at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
              at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
              at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
              at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
              at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy774.execute(Unknown Source)
              at com.atlassian.upm.PluginAccessorAndControllerImpl.installPlugin(PluginAccessorAndControllerImpl.java:65)
              at com.atlassian.upm.impl.PluginArtifactInstallHandler.installPlugin(PluginArtifactInstallHandler.java:30)
              at com.atlassian.upm.PluginInstaller.execute(PluginInstaller.java:124)
              at com.atlassian.upm.PluginInstaller.install(PluginInstaller.java:81)
              at com.atlassian.upm.rest.resources.install.InstallFromFileTask.executeTask(InstallFromFileTask.java:32)
              at com.atlassian.upm.rest.resources.install.InstallTask.call(InstallTask.java:30)
              at com.atlassian.upm.rest.resources.install.InstallTask.call(InstallTask.java:15)
              at com.atlassian.upm.rest.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:72)
              at com.atlassian.upm.rest.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:65)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
              at java.util.concurrent.FutureTask.run(FutureTask.java:138)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NoClassDefFoundError: com/atlassian/greenhopper/plugin/link/LinkProvider
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
              at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1829)
              at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:716)
              at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
              at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
              at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:634)
              at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1594)
              at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:887)
              at com.atlassian.plugin.osgi.util.BundleClassLoaderAccessor.loadClass(BundleClassLoaderAccessor.java:46)
              at com.atlassian.plugin.osgi.factory.OsgiPluginInstalledHelper.loadClass(OsgiPluginInstalledHelper.java:63)
              at com.atlassian.plugin.osgi.factory.OsgiPlugin.loadClass(OsgiPlugin.java:150)
              at com.atlassian.plugin.module.LegacyModuleFactory.getModuleClass(LegacyModuleFactory.java:27)
              ... 91 more
      Caused by: java.lang.ClassNotFoundException: com.atlassian.greenhopper.plugin.link.LinkProvider
              at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
              at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
              at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
              ... 106 more
      

      My plugin: https://plugins.atlassian.com/plugin/details/28621
      Affects too: https://plugins.atlassian.com/plugin/details/23983

      Attachments

        Activity

          People

            Unassigned Unassigned
            37db95e9e870 Damian Nowak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: