Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Theme Tutorial - Theme Plugin cannot be enabled due to error during startup

Hi,

I am following the SDK tutorial "Writing a Confluence Theme" (https://developer.atlassian.com/confdev/tutorials/writing-a-confluence-theme) and am stuck in step 3, because when I start Confluence via atlas-run, I get an error in the log that the class "com.atlassian.confluence.themes.BasicTheme" cannot be loaded:

com.atlassian.plugin.module.ModuleClassNotFoundException: Couldn't load the class 'com.atlassian.confluence.themes.BasicTheme'. This could mean that you misspelled the name of the class (double check) or that you're using a class in your plugin that you haven't provided bundle instructions for. See https://developer.atlassian.com/x/mQAN for more details on how to fix this.

I am trying to get the custom theme to run out of Eclipse, Confluence itself does start up, but I don't see the theme listed in Configuration -> Look and Feel -> Themes.

Do I need to declare the BasicTheme class somewhere? it shows up in my Eclipse project under Referenced LIbraries > confluence-5.9.1.jar and is correctly referenced in my proiect's atlassian-plugin.xml file.

There is no note in the documentation that I need to do anything to make this class visible.

Can somebody who has successfully gone through this tutorial help me?

 

My system:

Confluence Version: 5.9.1

Atlassian SDK Version 6.1.0

 

7 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

You need to add com.atlassian.confluence.themes to the <Import-Package> definition in your pom.

<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>
        <instructions>
            <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
            <Spring-Context>*</Spring-Context>
            <Export-Package />
            <Import-Package>
                com.atlassian.confluence.themes,
                com.atlassian.confluence.plugin.descriptor,
                org.springframework.osgi.*;resolution:="optional",
                org.eclipse.gemini.blueprint.*;resolution:="optional",
                com.atlassian.plugin.osgi.bridge.external,
                *;resolution:=optional
            </Import-Package>
        </instructions>
    </configuration>
</plugin>

Unfortunately not :sad:

Hi,

Did you find an answer to this yet?

bump. I am also stuck on this one. 

I made this work by doing the follow workaround: Create an empty class that just extends the above BasicTheme. (I didn't have need for overriding methods). In the atlassian-plugin.xml declare as class newly created class and in the pom import the 

com.atlassian.confluence.*;resolution:="optional"

You need to add com.atlassian.confluence.themes to the <Import-Package> definition in your pom.

<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>
        <instructions>
            <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
            <Spring-Context>*</Spring-Context>
            <Export-Package />
            <Import-Package>
                com.atlassian.confluence.themes,
                com.atlassian.confluence.plugin.descriptor,
                org.springframework.osgi.*;resolution:="optional",
                org.eclipse.gemini.blueprint.*;resolution:="optional",
                com.atlassian.plugin.osgi.bridge.external,
                *;resolution:=optional
            </Import-Package>
        </instructions>
    </configuration>
</plugin>

You need to add com.atlassian.confluence.themes to the <Import-Package> definition in your pom.

<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>
        <instructions>
            <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
            <Spring-Context>*</Spring-Context>
            <Export-Package />
            <Import-Package>
                com.atlassian.confluence.themes,
                com.atlassian.confluence.plugin.descriptor,
                org.springframework.osgi.*;resolution:="optional",
                org.eclipse.gemini.blueprint.*;resolution:="optional",
                com.atlassian.plugin.osgi.bridge.external,
                *;resolution:=optional
            </Import-Package>
        </instructions>
    </configuration>
</plugin>

Thanks, I'll try this out when I have time :)

(Sorry, I forgot to reply to your initial answer)

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you