Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

install a plugin error

thomasy Jacky January 11, 2024

i developed a plugin ,it can be installed successful in 8.x confluence server, but is not installed in 6.14.3 version

the following error is that.

atlassian/application-data/confluence/plugins-cache/1704961542552plugin_1766518416791517307_myConfluenceMacro-1.0.2-SNAPSHOT.jar (1704961542000)'.
2024-01-11 17:26:24,470 ERROR [localhost-startStop-1] [atlassian.plugin.loaders.ScanningPluginLoader] deployPluginFromUnit Because of the following exception:
java.lang.NullPointerException
at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.addHostComponentsUsedInSuperClasses(HostComponentSpringStage.java:225)
at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.findUsedHostComponents(HostComponentSpringStage.java:210)
at com.atlassian.plugin.osgi.factory.transform.stage.HostComponentSpringStage.execute(HostComponentSpringStage.java:65)
at com.atlassian.plugin.osgi.factory.transform.DefaultPluginTransformer.transform(DefaultPluginTransformer.java:140)
at com.atlassian.plugin.osgi.factory.OsgiPluginFactory.createOsgiPluginJar(OsgiPluginFactory.java:329)
at com.atlassian.plugin.osgi.factory.OsgiPluginFactory.create(OsgiPluginFactory.java:231)
at com.atlassian.plugin.loaders.ScanningPluginLoader.deployPluginFromUnit(ScanningPluginLoader.java:142)
at com.atlassian.plugin.loaders.ScanningPluginLoader.loadAllPlugins(ScanningPluginLoader.java:87)
at com.atlassian.plugin.loaders.ForwardingPluginLoader.loadAllPlugins(ForwardingPluginLoader.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy125.loadAllPlugins(Unknown Source)
at com.atlassian.plugin.loaders.PermissionCheckingPluginLoader.loadAllPlugins(PermissionCheckingPluginLoader.java:28)
at com.atlassian.plugin.manager.DefaultPluginManager.earlyStartup(DefaultPluginManager.java:548)
at com.atlassian.confluence.plugin.ConfluencePluginManager.earlyStartup(ConfluencePluginManager.java:147)
at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:72)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5109)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

 

my pom.xml is that 

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.atlassian.tutorial</groupId>
<artifactId>myConfluenceMacro</artifactId>
<version>1.0.2-SNAPSHOT</version>

<organization>
<name>Atlassian SDK Tutorial - Create a Confluence Hello World Macro</name>
<url>http://developer.atlassian.com/</url>
</organization>

<name>myConfluenceMacro</name>
<description>This is the com.atlassian.tutorial:myConfluenceMacro plugin for Atlassian Confluence.</description>
<packaging>atlassian-plugin</packaging>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence</artifactId>
<version>${confluence.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-runtime</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>

<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>


<dependency>
<groupId>com.theokanning.openai-gpt3-java</groupId>
<artifactId>api</artifactId>
<version>0.18.2</version>
</dependency>

<dependency>
<groupId>com.theokanning.openai-gpt3-java</groupId>
<artifactId>client</artifactId>
<version>0.18.2</version>
</dependency>

<dependency>
<groupId>com.theokanning.openai-gpt3-java</groupId>
<artifactId>service</artifactId>
<version>0.18.2</version>
</dependency>

</dependencies>

<!--<build>-->
<!--<plugins>-->
<!--<plugin>-->
<!--<groupId>com.atlassian.maven.plugins</groupId>-->
<!--<artifactId>maven-confluence-plugin</artifactId>-->
<!--<version>${amps.version}</version>-->
<!--<extensions>true</extensions>-->
<!--<configuration>-->
<!--<productVersion>${confluence.version}</productVersion>-->
<!--<productDataVersion>${confluence.data.version}</productDataVersion>-->
<!--<enableQuickReload>true</enableQuickReload>-->
<!--<enableFastdev>false</enableFastdev>-->

<!--&lt;!&ndash; See here for an explanation of default instructions: &ndash;&gt;-->
<!--&lt;!&ndash; https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins &ndash;&gt;-->
<!--<instructions>-->
<!--<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>-->

<!--&lt;!&ndash; Add package to export here &ndash;&gt;-->
<!--<Export-Package>-->
<!--com.atlassian.tutorial.api,-->
<!--</Export-Package>-->

<!--&lt;!&ndash; Add package import here &ndash;&gt;-->
<!--<Import-Package>-->
<!--org.springframework.osgi.*;resolution:="optional",-->
<!--org.eclipse.gemini.blueprint.*;resolution:="optional",-->
<!--*-->
<!--</Import-Package>-->

<!--&lt;!&ndash; Ensure plugin is spring powered &ndash;&gt;-->
<!--<Spring-Context>*</Spring-Context>-->
<!--</instructions>-->
<!--</configuration>-->
<!--</plugin>-->

<!--<plugin>-->
<!--<groupId>com.atlassian.plugin</groupId>-->
<!--<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>-->
<!--<version>${atlassian.spring.scanner.version}</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>atlassian-spring-scanner</goal>-->
<!--</goals>-->
<!--<phase>process-classes</phase>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<scannedDependencies>-->
<!--<dependency>-->
<!--<groupId>com.atlassian.plugin</groupId>-->
<!--<artifactId>atlassian-spring-scanner-external-jar</artifactId>-->
<!--</dependency>-->
<!--</scannedDependencies>-->
<!--<verbose>false</verbose>-->
<!--</configuration>-->
<!--</plugin>-->
<!--</plugins>-->
<!--</build>-->
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>confluence-maven-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${confluence.version}</productVersion>
<productDataVersion>${confluence.data.version}</productDataVersion>
<!--<jvmArgs>-Xms1g -Xmx2g -XX:MaxPermSize=1g -XX:-UseGCOverheadLimit -server</jvmArgs>-->
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<confluence.version>5.10.7</confluence.version>
<confluence.data.version>5.10.7</confluence.data.version>
<amps.version>8.9.2</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
</properties>

</project>

 

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2024

Hi Thomasy,

I've written a lot of Atlassian apps in the past, and in my experience, apps need to be built and compiled for at least the major version of the system you're going to plug it into.

That is, an app compiled for 6.x.x is not likely to work in 7.x.x and extremely unlikely to work on 5.x.x.

It is possible to create apps that span large ranges of versions, but it's difficult, far beyond me.  And some major version releases are simply completely incompatible.  It is not possible to write an app for Jira 6 and 7 at the same time for example.  I seem to remember Confluence has a similar break at 2 -> 3, 3 -> 4, and 7 -> 8.

You need to build your app for Confluence 6 if you want it to work on that version.  Unless you're doing something very clever and specific, it should work fine for all 6.x versions, and has a good chance of working on 7.x.  But you'll need to branch and update it for 8, no question.

thomasy Jacky January 11, 2024

your answer is very important ,tks

0 votes
Aaron Pavez _ServiceRocket_
Community Champion
January 11, 2024

Hi @thomasy Jacky 

I'm not a SW Dev, but I've seen happening due to the many dependencies/libraries/differences between Confluence 6.x and 8.x.

Even a small version update can break a plugin when Atlassian introduces new changes.

Something that works in 8.x doesn't mean it will work in a previous, really old EOL version.

Hope that helps!

Regards

thomasy Jacky January 11, 2024

but this plugin codes are base on 5.x version ,i just add some jars ,use the original pom.xml ,i just import  other depencies ,it doesn't make a jar ,so it real matters with me!!!

thomasy Jacky January 11, 2024

thks ,your advise is helpful for me !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events