Missed Team ’24? Catch up on announcements here.

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

java.lang.NoClassDefFoundError for AbstractJiraContextProvider

udogan June 9, 2013

We are developing a custom plugin which has dependency to jira-tempo plugin. We had dependency problem with jira tempo and overcame with creating our custom plugin as obr. Now we have an error which is annoying us from last 2 weeks. Our module can not enabled because of the error which is at below.

Our pom.xml is:

<dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <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>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.8.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ofbiz</groupId>
            <artifactId>ofbcore-share</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>com.tempoplugin</groupId>
            <artifactId>tempoplugin</artifactId>
            <version>7.6.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>2.5.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <version>${jira.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <classifier>classes</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.tempoplugin</groupId>
                            <artifactId>tempoplugin</artifactId>
                            <version>7.6.2</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <pluginDependencies>
                        <pluginDependency>
                            <groupId>com.tempoplugin</groupId>
                            <artifactId>tempoplugin</artifactId>
                        </pluginDependency>
                    </pluginDependencies>
                    <instructions>
                        <Import-Package>is.origo.jira.tempo-plugin*;version="7.6.2"</Import-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

The error is (I removed some logs to make it more readable):

[INFO] [talledLocalContainer] 2013-06-10 11:47:01,101 main ERROR [atlassian.plugin.manager.DefaultPluginManager] There was an error loading the descriptor 'DailyWorklogWebPanel' of plugin 'com.kartaca.tempo'. Disabling.
[INFO] [talledLocalContainer] java.lang.NoClassDefFoundError: com/atlassian/jira/plugin/webfragment/contextproviders/AbstractJiraContextProvider
[INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass1(Native Method)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1829)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:716)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:634)
[INFO] [talledLocalContainer] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1594)
[INFO] [talledLocalContainer] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:887)
[INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.util.BundleClassLoaderAccessor.loadClass(BundleClassLoaderAccessor.java:46)
[INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.factory.OsgiPluginInstalledHelper.loadClass(OsgiPluginInstalledHelper.java:63)
...
...
...
...
[INFO] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: com.atlassian.jira.plugin.webfragment.contextproviders.AbstractJiraContextProvider
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
[INFO] [talledLocalContainer] at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
[INFO] [talledLocalContainer] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Nicolas Joseph June 20, 2013

I resolved this problem by insering this in the pom between the configuration tags ( just where you must have declared the package import from the obr dependencies):

<instructions>
<!-- Specify what package to include. Ensure that any packages from OBRs are also listed. -->
    <Import-Package>
...
com.atlassian.jira.plugin.webfragment.contextproviders ; version=1.0
...
    </Import-Package>
    <CONF_COMM/>
</instructions>

This is weird because it should be imported by default anyway, however, it seems to work.

EDIT : It seems that all packages used in the plugin generating the obr should be imported the same way

0 votes
Viðar Svansson [Tempo]
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.
June 19, 2013
0 votes
Nicolas Joseph June 18, 2013

Got the same issue ...

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events