Forums

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

com.atlassian.plugin.spring.scanner.annotation - is not a concrete class

Raj Karan
Contributor
April 2, 2019

I am following hello world tutorial and getting below error on my very first compile.

[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.StashImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.RefappImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.FecruImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.ConfluenceImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.BitbucketImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.imports.BambooImport] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.export.ModuleType] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.StashComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.RefappComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.JiraComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.FecruComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.ConfluenceComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.ClasspathComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.BitbucketComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!
[ERROR] Found a type [com.atlassian.plugin.spring.scanner.annotation.component.BambooComponent] annotated as a component, but the type is not a concrete class. NOT adding to index file!!

 I have looked at another similar question but couldn't resolve this issue.

below is my pom.xml

<?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.0-SNAPSHOT</version>

<organization>
<name>Example Company</name>
<url>http://www.example.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>
</dependencies>

<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>
<enableQuickReload>true</enableQuickReload>

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

<!-- Add package to export here -->
<Export-Package>
com.atlassian.tutorial.api,
</Export-Package>

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

<!-- Ensure plugin is spring powered -->
<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>

<properties>
<confluence.version>6.14.0</confluence.version>
<confluence.data.version>6.14.0</confluence.data.version>
<amps.version>8.0.0</amps.version>
<plugin.testrunner.version>2.0.1</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This property ensures consistency between the key in atlassian-plugin.xml and the OSGi bundle's key. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

</project>

 

below is my atlassian-plugin.xml

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>

<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="myConfluenceMacro"/>

<!-- add our web resources -->
<web-resource key="myConfluenceMacro-resources" name="myConfluenceMacro Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>

<resource type="download" name="myConfluenceMacro.css" location="/css/myConfluenceMacro.css"/>
<resource type="download" name="myConfluenceMacro.js" location="/js/myConfluenceMacro.js"/>
<resource type="download" name="images/" location="/images"/>

<context>myConfluenceMacro</context>
</web-resource>

<xhtml-macro name="helloworld" class="com.atlassian.tutorial.macro.helloworld" key='helloworld-macro'>
<description key="helloworld.macro.desc"/>
<category name="formatting"/>
<parameters>
<parameter name="Name" type="string" />
<parameter name="Color" type="enum">
<value name="red"/>
<value name="green"/>
<value name="blue"/>
</parameter>
</parameters>
</xhtml-macro>

</atlassian-plugin>

I tried to migrate from spring-scanner 1.2.13 to 2.0 with the help of this tutorial https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/ but this caused more issues, so I reverted them.

 

Any help regarding this issue.

 

2 answers

1 accepted

2 votes
Answer accepted
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2019

Hello there!

Raj, this error is most likely thrown due to the fact that the your scanner is scanning its own types. You should be able to check the bigger discussion and how to fix this here:

SCANNER-24 | Scanner logs ERRORs about own annotations not being components

The workaround to this would be to set this under the plugin configuration file:

<includeExclude>-com.atlassian.plugin.spring.scanner.annotation.*</includeExclude>

Looking forward to your reply!

Dharanitharan June 7, 2019

@Diego  I am new to plugin development and I had a small doubt what do you mean by a plugin configuration file and where do I find it?

Nici Emmel September 13, 2019

Hi @Dharanitharan

I think Diego means the pom.xml, here you have following tag structur in which you also find the configuration tag.

<project ... >
<build>
<plugins>
<plugin>
<configuration>
...
</configuration>
</plugin>
</plugins>
</build>
...

Best regards,
Nici

Dharanitharan September 13, 2019

Hi Nici,
Thanks for the reply, I have that issue resolved on the same day but I forgot to update it here.


Thanks again,
Dharanitharan

Sathish K
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 26, 2020

Hi,

Ho did you solved the issue.

 

Thanks.

0 votes
Alexandru Matei
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 23, 2023

The "Hello world" article has, unfortunately, not been updated.

Unfortunately, the source code has not been updated also.

file https://bitbucket.org/serverecosystem/myconfluencemacro/src/master/src/main/java/com/atlassian/tutorial/macro/helloworld.java is incorrect

The solution is to comment lines 6 and 13

// import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;

// @Scanned

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events