Testing on Platform 7 and API Rest migration from v1 to v2

Hello everyone,

We have spent the last couple of days testing the EAP of Platform 7 for Jira, during which we had to adapt certain dependencies and resources of our applications. However, one of the issues we are encountering is during the installation process, specifically in the rest api module.

We have added the necessary dependencies and tags for the API migration from version 1 to 2.

    <rest-migration key="rest-migration-key">
        <rest-v2/>
    </rest-migration>>

Nevertheless, we encounter the following error:

2024-04-17 17:13:02,285+0200 UpmAsynchronousTaskManager:thread-1 ERROR qa.admin     [c.a.plugin.manager.DefaultPluginManager] There was an error loading the descriptor 'rest_api_v2' of plugin 'com.apps.test'. Disabling.
java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9
	at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:281)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:706)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
	at com.atlassian.plugins.rest.v2.scanner.JarIndexer.analyzeClassFile(JarIndexer.java:76)
	at com.atlassian.plugins.rest.v2.scanner.JarIndexer.scanJar(JarIndexer.java:64)
	at com.atlassian.plugins.rest.v2.scanner.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:46)
	at com.atlassian.plugins.rest.v2.jersey.ResourceConfigFactory.createConfig(ResourceConfigFactory.java:74)
	at com.atlassian.plugins.rest.v2.servlet.RestDelegatingServletFilter.<init>(RestDelegatingServletFilter.java:66)
	at com.atlassian.plugins.rest.v2.descriptor.RestServletFilterModuleDescriptor.<init>(RestServletFilterModuleDescriptor.java:37)
	at com.atlassian.plugins.rest.v2.descriptor.RestModuleDescriptor.enabled(RestModuleDescriptor.java:163)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$notifyModuleEnabled$47(DefaultPluginManager.java:1890)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.notifyModuleEnabled(DefaultPluginManager.java:1886)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$enableConfiguredPluginModule$32(DefaultPluginManager.java:1631)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:72)
	at com.atlassian.plugin.manager.DefaultPluginManager.enableConfiguredPluginModule(DefaultPluginManager.java:1615)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$enableConfiguredPluginModules$31(DefaultPluginManager.java:1606)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:72)
	at com.atlassian.plugin.manager.DefaultPluginManager.enableConfiguredPluginModules(DefaultPluginManager.java:1603)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$enableDependentPlugins$24(DefaultPluginManager.java:1258)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.enableDependentPlugins(DefaultPluginManager.java:1228)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$addPlugins$22(DefaultPluginManager.java:1213)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.addPlugins(DefaultPluginManager.java:1113)
	at com.atlassian.jira.plugin.JiraPluginManager.addPlugins(JiraPluginManager.java:165)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$scanForNewPlugins$14(DefaultPluginManager.java:920)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.scanForNewPlugins(DefaultPluginManager.java:876)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$installPlugins$13(DefaultPluginManager.java:836)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.installPlugins(DefaultPluginManager.java:822)
	at com.atlassian.jira.plugin.JiraPluginManager.installPlugins(JiraPluginManager.java:175)
	at jdk.internal.reflect.GeneratedMethodAccessor674.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
	at jdk.proxy3/jdk.proxy3.$Proxy115.installPlugins(Unknown Source)
	at jdk.internal.reflect.GeneratedMethodAccessor674.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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)
	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 org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
	at jdk.proxy9/jdk.proxy9.$Proxy990.installPlugins(Unknown Source)
	at com.atlassian.upm.core.install.AbstractPluginInstallHandler$1.doInTransaction(AbstractPluginInstallHandler.java:133)
	at com.atlassian.upm.core.install.AbstractPluginInstallHandler$1.doInTransaction(AbstractPluginInstallHandler.java:128)
	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21)
	at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:50)
	at jdk.internal.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
	at jdk.proxy3/jdk.proxy3.$Proxy430.doInTransaction(Unknown Source)
	at jdk.internal.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:130)
	at jdk.proxy3/jdk.proxy3.$Proxy430.doInTransaction(Unknown Source)
	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18)
	at jdk.internal.reflect.GeneratedMethodAccessor238.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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)
	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 org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
	at jdk.proxy9/jdk.proxy9.$Proxy1000.execute(Unknown Source)
	at com.atlassian.upm.core.install.AbstractPluginInstallHandler.installArtifacts(AbstractPluginInstallHandler.java:127)
	at com.atlassian.upm.core.install.AbstractPluginInstallHandler.installArtifact(AbstractPluginInstallHandler.java:113)
	at com.atlassian.upm.core.install.JarPluginInstallHandler.installPluginInternal(JarPluginInstallHandler.java:52)
	at com.atlassian.upm.core.install.AbstractPluginInstallHandler.installPlugin(AbstractPluginInstallHandler.java:54)
	at com.atlassian.upm.core.install.DefaultPluginInstallationService.execute(DefaultPluginInstallationService.java:130)
	at com.atlassian.upm.core.install.DefaultPluginInstallationService.install(DefaultPluginInstallationService.java:98)
	at com.atlassian.upm.install.UpmPluginInstallationService.install(UpmPluginInstallationService.java:114)
	at com.atlassian.upm.core.rest.resources.install.InstallTask.installFromFile(InstallTask.java:153)
	at com.atlassian.upm.core.rest.resources.install.InstallFromFileTask.executeTask(InstallFromFileTask.java:36)
	at com.atlassian.upm.core.rest.resources.install.InstallTask.run(InstallTask.java:78)
	at com.atlassian.upm.core.async.AsynchronousTaskManager.executeTask(AsynchronousTaskManager.java:121)
	at com.atlassian.upm.core.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:99)
	at com.atlassian.upm.core.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:96)
	at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)

It does not happen with all Rest controllers, only with some of them. However, the error is quite misleading as it happens during the Jar analysis, and refers to the ASM9 version requirement.

I understand that this reference is necessary to carry out the analysis, and not because of the content of the App.

I don’t know if anyone has experienced something similar or has any idea of where the problem might come from.

Thank you in advance
Carlos MartĂ­n

1 Like

Hello @carlos.martin

  After converting Jira Plugin from v1 to v2 I am getting error of not found 404 in my all custom APIS.  Please help me. 

image

Hi @mihirvarsani
We also landed into same issue. Do you any suggestion for this issue, please?

Hi @RajeshKaruturi

Add below lines in import package it’s work for me

javax.ws.rs;version=“[2.0.0,3.0.0)”,
javax.ws.rs.core;version=“[2.0.0,3.0.0)”,
javax.ws.rs.ext;version=“[2.0.0,3.0.0)”

Thanks @mihirvarsani for the quick help.
Assuming you are using the build dependency 2.1.6. After this change we landed into a different issue as pasted below. We think, these all issues are related to build dependency mismatches. Please suggest, if you also met similar dependency issue.

<dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <version>2.1.6</version>
            <scope>compile</scope>
        </dependency>
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/type/TypeReference
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
	at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
	... 20 more
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.type.TypeReference not found by aio.jira.connector.aio-app-tableau [184]
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
	at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)

Thanks,
Rajesh

Any one observed this behaviour, our rest-migration-key module disabled in Module section in our plugin , due to that we are facing 404 errors on rest API in conf 8.7.1 . Tested this behaviour from 7.19,8.0 and 8.5 working fine. But in confluence 8.7 rest api’s are not working.

Here is the screen shots


Can you please suggest on this what could be the reason for this. This is not only for my app, there several apps which are failed in 8.7 version with this issue.

1 Like

Hi Dharma, we have the same issue with our app. In Confluence 8.7.2, REST API module is always get disabled if the rest-migration-key is present (while in 8.5.14 LTS, it works fine). You mentioned that several apps also fail, can you tell me some examples?

Hi @gabor.nagy :- The tag we added as part of rest V2 changes is no more required. Please remove this tag from atlassian-plugin.xml file.

We no more required this tag in atlassian-plugin.xml file. Platform 7 changes are introduced from 8.7 Confluence version, from 8.7 onwards with these changes I observed, after these changes it is working in all versions.

<rest-migration key="rest-migration-key">
  <rest-v2/>
</rest-migration>
Please refer this for more details

https://community.developer.atlassian.com/t/preparing-for-confluence-9-0-eap-out-now/76160/481

1 Like

@DharmaTeja, thank you very much for sharing this!