Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-78645

App licensing breaks with ClassCastException errors

XMLWordPrintable

      Issue Summary

      There are conditions within Universal Plugin Manager (UPM) that may break its licensing feature.
      This may make the current node unusable to end-users, specially those features related to licensed Marketplace Apps.

      Steps to Reproduce

      1. Install a vanilla instance of Jira Software Data Center.
        • This was validated on JSW DC versions 10.4.0, 9.12 and 9.4.
      2. Install a Marketplace App that will show a status of DATA CENTER UPDATE AVAILABLE.
      3. Go to Versions & licenses admin page.
      4. Edit the Jira Software license key and paste a new license.
      5. Click on Update license
        • This triggers a POST /rest/plugins/applications/1.0/installed/jira-software/license request that results on a HTTP 400 status with a valid response from Jira.
      6. On the UI, a pop-up with "app will be impacted by this change" is shown.
      7. Click on Cancel which won't proceed with the license change.

      Expected Results

      No feature is impacted by this and Jira works normally as no change was committed.

      Actual Results

      UPM licensing features break.

      Errors similar to the below are seen on the logs.

      2025-02-27 21:40:07,796+0000 http-nio-8080-exec-34 url: /rest/plugins/1.0/notifications; user: admin ERROR admin 1300x5712x4 19l3vjv 10.224.56.123,10.232.36.32 /rest/plugins/1.0/notifications [c.a.p.r.v2.exception.ThrowableExceptionMapper] Uncaught exception e34db11b-7d2d-4a55-9884-bc346b2ce076 thrown by REST service: class com.atlassian.upm.license.internal.HostApplicationLicense cannot be cast to class com.atlassian.upm.license.internal.HostApplicationLicense (com.atlassian.upm.license.internal.HostApplicationLicense is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @17b9c842; com.atlassian.upm.license.internal.HostApplicationLicense is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @74babcaa)
      java.lang.ClassCastException: class com.atlassian.upm.license.internal.HostApplicationLicense cannot be cast to class com.atlassian.upm.license.internal.HostApplicationLicense (com.atlassian.upm.license.internal.HostApplicationLicense is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @17b9c842; com.atlassian.upm.license.internal.HostApplicationLicense is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @74babcaa)
      	at com.atlassian.upm.license.internal.host.AbstractHostLicenseProvider.getEdition(AbstractHostLicenseProvider.java:84)
      	at com.atlassian.upm.license.internal.host.AbstractHostLicenseProvider.getHostApplicationLicenseAttributes(AbstractHostLicenseProvider.java:356)
      	at com.atlassian.upm.impl.UpmHostApplicationInformationImpl.isHostDataCenterEnabled(UpmHostApplicationInformationImpl.java:49)
      	at com.atlassian.upm.license.impl.LicensedPlugins.isWrongAppType(LicensedPlugins.java:146)
      	at com.atlassian.upm.license.impl.LicensedPlugins.checkForWrongAppTypeAction(LicensedPlugins.java:127)
      	at com.atlassian.upm.license.impl.LicensedPlugins.getPrimaryPluginActionRequired(LicensedPlugins.java:115)
      	at com.atlassian.upm.rest.representations.UpmRepresentationFactoryImpl.createInstalledMarketplacePluginRepresentation(UpmRepresentationFactoryImpl.java:249)
      	at com.atlassian.upm.rest.representations.InstalledMarketplacePluginRepresentation$PluginToRepFunction.apply(InstalledMarketplacePluginRepresentation.java:226)
      	at com.atlassian.upm.rest.representations.InstalledMarketplacePluginRepresentation$PluginToRepFunction.apply(InstalledMarketplacePluginRepresentation.java:206)
      	at com.atlassian.upm.notification.rest.representations.NotificationRepresentationFactoryImpl$ToNotificationRepresentation.apply(NotificationRepresentationFactoryImpl.java:260)
      	at com.atlassian.upm.notification.rest.representations.NotificationRepresentationFactoryImpl$ToNotificationRepresentation.apply(NotificationRepresentationFactoryImpl.java:218)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
      	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
      	at com.atlassian.upm.notification.rest.representations.NotificationRepresentationFactoryImpl.getNotificationGroup(NotificationRepresentationFactoryImpl.java:160)
      	at com.atlassian.upm.notification.rest.representations.NotificationRepresentationFactoryImpl.getNotificationGroupCollection(NotificationRepresentationFactoryImpl.java:119)
      	at com.atlassian.upm.notification.rest.resources.NotificationCollectionResource.getNotifications(NotificationCollectionResource.java:75)
      	at jdk.internal.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
      	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
      	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
      	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
      	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
      	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
      	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235)
      	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
      	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
      	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
      	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:359)
      	at com.atlassian.plugins.rest.v2.jersey.JerseyOsgiServletContainer.doFilter(JerseyOsgiServletContainer.java:80)
      	at org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:432)
      	at com.atlassian.plugins.rest.v2.servlet.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:84)
      
      2025-02-27 21:40:18,081+0000 http-nio-8080-exec-53 url: /secure/WorkflowUIDispatcher.jspa; user: admin ERROR admin 1300x5735x1 19l3vjv 10.224.56.123,10.232.36.32 /secure/WorkflowUIDispatcher.jspa [c.a.jira.workflow.OSWorkflowManager] Caught exception while attempting to perform action 21 from workflow 10105 on issue 'SCRUM1-6'
      java.lang.ClassCastException: class com.atlassian.upm.api.util.Option$Some cannot be cast to class com.atlassian.upm.api.util.Option (com.atlassian.upm.api.util.Option$Some is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @17b9c842; com.atlassian.upm.api.util.Option is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @74babcaa)
      	at com.atlassian.upm.license.internal.impl.PluginLicenseRepositoryImpl.getCachedLicense(PluginLicenseRepositoryImpl.java:332)
      	at com.atlassian.upm.license.internal.impl.PluginLicenseRepositoryImpl.getPluginLicense(PluginLicenseRepositoryImpl.java:148)
      	at com.atlassian.upm.license.internal.impl.PluginLicenseManagerImpl.getLicense(PluginLicenseManagerImpl.java:42)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      



      Trying to access UPM UI (Manage Apps or Find New Apps) throws an error on UI as below.


      Features related to licensed Apps may break, possibly making the node unusable to end-users.
      For example, trying to use a feature from a licensed Marketplace App as a post-funtion breaks the workflow as below.

      Workaround

      Restart the affected node.

        1. screenshot-1.png
          screenshot-1.png
          358 kB
        2. screenshot-2.png
          screenshot-2.png
          518 kB
        3. screenshot-3.png
          screenshot-3.png
          461 kB
        4. image-2025-02-28-09-00-56-428.png
          image-2025-02-28-09-00-56-428.png
          1.34 MB
        5. image-2025-02-28-09-02-03-445.png
          image-2025-02-28-09-02-03-445.png
          1.14 MB

              21d451cf00e1 Dominik Wojtasik
              tmasutti Thiago Masutti (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated:
                Resolved: