Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-80587

Plugins compiled against Confluence 7.x that use AbstractActionBreadcrumb constructors are incompatible with Confluence 8.x

    XMLWordPrintable

Details

    Description

      Issue Summary

      If a plugin class constructs a breadcrumb object which extends AbstractActionBreadcrumb in Confluence 7.x, the compiled plugin will fail to load on Confluence 8.x due to incompatible bytecode.

      Steps to Reproduce

      1. Add a code snippet similar to the following to your plugin's XWork Action class
      public Breadcrumb getBreadcrumb() { 
          return new UserProfileActionBreadcrumb(this);
      }
      1. Compile plugin against Confluence 7.x
      2. Load plugin on Confluence 8.x

      Expected Results

      Plugin loads and functions as expected with no errors in logs

      Actual Results

      If wildcard package resolution is enabled you will receive an OSGi error similar to the following:

      Caused by: org.osgi.framework.BundleException: Unable to resolve com.atlassian.confluence.plugins.confluence-notifications-spi-plugin [305](R 305.0): missing requirement [com.atlassian.confluence.plugins.confluence-notifications-spi-plugin [305](R 305.0)] osgi.wiring.package; (osgi.wiring.package=com.opensymphony.xwork) Unresolved requirements: [[com.atlassian.confluence.plugins.confluence-notifications-spi-plugin [305](R 305.0)] osgi.wiring.package; (osgi.wiring.package=com.opensymphony.xwork)]

      Otherwise you will receive the following class load error:

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.confluence.notifications.impl.ConfluenceUserSettingsAction': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.atlassian.confluence.notifications.impl.ConfluenceUserSettingsAction] from ClassLoader [com.atlassian.confluence.plugins.confluence-notifications-spi-plugin [78]]
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:289)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1302)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1219)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)
          at jdk.internal.reflect.GeneratedMethodAccessor229.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at com.atlassian.confluence.plugin.LegacySpringContainerAccessor.createBean(LegacySpringContainerAccessor.java:76)
          at com.atlassian.confluence.impl.struts.PluginAwareActionFactory.buildAction(PluginAwareActionFactory.java:38)
          at com.atlassian.confluence.impl.struts.PluginAwareActionFactory.buildAction(PluginAwareActionFactory.java:26)
          at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:142)
          at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:301)
          ... 329 more
      Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.atlassian.confluence.notifications.impl.ConfluenceUserSettingsAction] from ClassLoader [com.atlassian.confluence.plugins.confluence-notifications-spi-plugin [78]]
          at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485)
          at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
          ... 342 more
      Caused by: java.lang.NoClassDefFoundError: com/opensymphony/xwork/Action
          at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
          at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
          at java.base/java.lang.Class.getDeclaredMethods(Class.java:2309)
          at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
          ... 344 more
      Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork.Action not found by com.atlassian.confluence.plugins.confluence-notifications-spi-plugin [78]
          at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1585)
          at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
          at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1970)
          at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
          ... 348 more

       

      Workaround

      TBA

      Attachments

        Activity

          People

            854eef6f5746 Kusal Kithul-Godage
            854eef6f5746 Kusal Kithul-Godage
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: