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

      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

          Form Name

            [CONFSERVER-80587] Plugins compiled against Confluence 7.x that use AbstractActionBreadcrumb constructors are incompatible with Confluence 8.x

            We face the same issue with

            Caused by: java.lang.NoClassDefFoundError: com/opensymphony/xwork/Action
            

            But this happens when the plugin is compiled against Confluence 8, but is deployed to Confluence 7...
            Compiling the same source code against Confluence 7 will make the OBR that works on Confluence 7 and Confluence 8

            Alex Medved {ConfiForms} added a comment - - edited We face the same issue with Caused by: java.lang.NoClassDefFoundError: com/opensymphony/xwork/Action But this happens when the plugin is compiled against Confluence 8, but is deployed to Confluence 7... Compiling the same source code against Confluence 7 will make the OBR that works on Confluence 7 and Confluence 8

            A fix for this issue is available in Confluence Server and Data Center 8.0.0.
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            James Whitehead added a comment - A fix for this issue is available in Confluence Server and Data Center 8.0.0. Upgrade now or check out the Release Notes to see what other issues are resolved.

            Investigating other affected methods/constructors

            Kusal Kithul-Godage added a comment - Investigating other affected methods/constructors

              854eef6f5746 Kusal Kithul-Godage
              854eef6f5746 Kusal Kithul-Godage
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: