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

Jira Custom Plugin Can Not Enabled

udogan June 10, 2013

Hi,

We are developing a Jira plugin which has dependency to Tempo plugin. We are usign Tempo plugin's methods and classes to make some calculations. We fallowed tutorials to create web-panel and etc. When we add dependency to Tempo plugin in pom.xml, our custom plugin enabled and worked without errors; but Tempo plugin started to get errors.

The error was:

[INFO] [talledLocalContainer] 2013-06-11 14:11:12,612 http-2990-5 ERROR admin 851x812x1 1waowtd 78.188.101.175 /secure/TempoInfo.jspa [jira.web.dispatcher.JiraWebworkActionDispatcher] Exception thrown from action 'TempoInfo', returning 404
[INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.tempoplugin.view.TempoInfoAction': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.tempoplugin.TempoServiceFactory]: : No unique bean of type [com.tempoplugin.TempoServiceFactory] is defined: Unsatisfied dependency of type [class com.tempoplugin.TempoServiceFactory]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.tempoplugin.TempoServiceFactory] is defined: Unsatisfied dependency of type [class com.tempoplugin.TempoServiceFactory]: expected at least 1 matching bean
...
...
[INFO] [talledLocalContainer] Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.tempoplugin.TempoServiceFactory] is defined: Unsatisfied dependency of type [class com.tempoplugin.TempoServiceFactory]: expected at least 1 matching bean


After searching the solution of the problem we saw a solution which was adding <component-import key="tempoServiceFactory" interface="com.tempoplugin.TempoComponent"/> to atlassian-plugin.xml.

After this addition another problem occurs. Our custom plugin can not enabled anymore.


The new error is:

[INFO] [talledLocalContainer] 2013-06-11 14:17:52,184 main ERROR      [plugin.osgi.factory.OsgiPlugin] Detected an error (BundleException) enabling the plugin 'com.kartaca.tempo' : Unresolved constraint in bundle com.kartaca.tempo [107]: Unable to resolve 107.0: missing requirement [107.0] package; (package=com.tempoplugin).  This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see http://confluence.atlassian.com/x/1xy6D
[INFO] [talledLocalContainer] 2013-06-11 14:17:52,186 main WARN      [plugin.osgi.factory.OsgiPlugin] Unable to enable plugin 'com.kartaca.tempo'
...
...
[INFO] [talledLocalContainer] Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.kartaca.tempo [107]: Unable to resolve 107.0: missing requirement [107.0] package; (package=com.tempoplugin)

Pom.xml:

&lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
            &lt;artifactId&gt;jira-api&lt;/artifactId&gt;
            &lt;version&gt;${jira.version}&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;junit&lt;/groupId&gt;
            &lt;artifactId&gt;junit&lt;/artifactId&gt;
            &lt;version&gt;4.10&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.atlassian.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;atlassian-plugins-osgi-testrunner&lt;/artifactId&gt;
            &lt;version&gt;${plugin.testrunner.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
            &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
            &lt;version&gt;1.1.1&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.mockito&lt;/groupId&gt;
            &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
            &lt;version&gt;1.8.5&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.ofbiz&lt;/groupId&gt;
            &lt;artifactId&gt;ofbcore-share&lt;/artifactId&gt;
            &lt;version&gt;2.1.1&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework&lt;/groupId&gt;
            &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
            &lt;version&gt;2.5.6&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.tempoplugin&lt;/groupId&gt;
            &lt;artifactId&gt;tempoplugin&lt;/artifactId&gt;
            &lt;version&gt;7.6.0.1&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
            &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
            &lt;version&gt;2.4&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
            &lt;artifactId&gt;jira-tests&lt;/artifactId&gt;
            &lt;version&gt;${jira.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
            &lt;artifactId&gt;jira-core&lt;/artifactId&gt;
            &lt;version&gt;${jira.version}&lt;/version&gt;
            &lt;classifier&gt;classes&lt;/classifier&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;com.atlassian.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-jira-plugin&lt;/artifactId&gt;
                &lt;version&gt;${amps.version}&lt;/version&gt;
                &lt;extensions&gt;true&lt;/extensions&gt;
                &lt;configuration&gt;
                    &lt;pluginArtifacts&gt;
                        &lt;pluginArtifact&gt;
                            &lt;groupId&gt;com.atlassian.activeobjects&lt;/groupId&gt;
                            &lt;artifactId&gt;activeobjects-plugin&lt;/artifactId&gt;
                            &lt;version&gt;0.19.7&lt;/version&gt;
                        &lt;/pluginArtifact&gt;
                        &lt;pluginArtifact&gt;
                            &lt;groupId&gt;com.atlassian.activeobjects&lt;/groupId&gt;
                            &lt;artifactId&gt;activeobjects-refapp-spi&lt;/artifactId&gt;
                            &lt;version&gt;0.19.7&lt;/version&gt;
                        &lt;/pluginArtifact&gt;
                    &lt;/pluginArtifacts&gt;
                    &lt;productVersion&gt;${jira.version}&lt;/productVersion&gt;
                    &lt;productDataVersion&gt;${jira.version}&lt;/productDataVersion&gt;
                    &lt;log4jProperties&gt;src/aps/log4j.properties&lt;/log4jProperties&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;source&gt;1.6&lt;/source&gt;
                    &lt;target&gt;1.6&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Alexej Geldt
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 3, 2014

this happens not only with Tempo plugin. We have same annoying problems trying to have a plugin being dependent on another plugin. This mechanism seems to be broken.

0 votes
Benedikt Bjarni Bogason [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 10, 2013

Hi, can I quickly enquire what problem you are trying to solve? Perhaps you can use our public API to solve this use case, or we might see value to add to our public API.

I *think* you can only import classes from the Tempo plugin that are explicitly exported in the Tempo pom.xml

Benedikt,

Tempo Team

udogan June 10, 2013

We tried two approaches for our plugin in order to use tempo-plugin;

1. First we tried adding tempo-plugin to our plugin's pom.xml as a dependency. Tempo-plugin's classes were added to our WEB-INF/lib and our plugin worked fine and dandy in this case. But when we tried to enable the original tempo-plugin with UPM, somehow it didn't work. We got this error:

[INFO] [talledLocalContainer] Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.tempoplugin.TempoServiceFactory] is defined: Unsatisfied dependency of type [class com.tempoplugin.TempoServiceFactory]: expected at least 1 matching bean

I think probably there were some cache issues. Because essentialy we were using two of the same manager/service running.

2. Second thing we tried is to add tempo-plugin with import package and add tempo-plugin as a plugin dependency in our pom.xml and create an obr for our plugin. Obr was created alright and the original tempo plugin would run alongside. But then this time, we got this error in our plugin:

[INFO] [talledLocalContainer] java.lang.NoClassDefFoundError: com/atlassian/jira/plugin/webfragment/contextproviders/AbstractJiraContextProvider
[INFO] [talledLocalContainer] at java.lang.ClassLoader.defineClass1(Native Method)

(which is weird because AbstractJiraContextProvider is in jira-api and jira-api was added in our pom.xml as a dependency). We tried addding component-imports to atlassian-plugin.xml for the services we wanted to use in tempo-plugin. But according to tempo's atlassian-plugin.xml those services were not public, private by default. So component-import didn't work either.

We finally decided to use tempo's public API and rewrite our plugin in that direction. If you have any suggestion to overcome the problems we mentioned above that would be really helpful, so we wouldn't have to rewrite the whole thing.

Benedikt Bjarni Bogason [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.
July 5, 2013

Hi,

Sorry for the late reply.

We have been conscientiously restricting access to our TempoServiceFactory class, as it is only meant for internal use by the plugin - it is a powerful beast, and you can wreak a lot of havoc by using it without knowing what you are doing. We have therefore considered it wiser to make that class private and instead offer a public API. We are very interested in hearing how other developers are using Tempo - and we would like to hear from you what we can do to make your job easier - such as what you feel is missing from our public API.

0 votes
Sverrir Tynes [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 10, 2013

There are two system plugins that Tempo depends on, Tempo Core and Tempo Teams.

https://tempoplugin.jira.com/wiki/display/CORE/Tempo+Core+Home
https://tempoplugin.jira.com/wiki/display/TEAMS/Tempo+Teams+Home

Please verify that the system plugins jars are available in the installed-plugins directory.

Sverrir Tynes
Tempo support

udogan June 10, 2013

Yes also we have
./jira/home/plugins/installed-plugins/tempo-teams-1.0.4.jar
./jira/home/plugins/installed-plugins/tempo-core-1.1.1.jar

0 votes
Jobin Kuruvilla [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.
June 10, 2013

This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package

Do you have the required Tempo version? You have 7.6.0.1 in the dependencies.

udogan June 10, 2013

Yes, we have ./jira/home/plugins/installed-plugins/tempo-plugin-7.6.0.1.jar

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