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

Problem with plugin tutorial "Writing JIRA event listeners with the atlassian-event library"

Arne Bergmann March 22, 2012

I am following the plugin tutorial "Writing JIRA event listeners with the atlassian-event library" and have a maven compilation error after adding the "Coordinate event registration with the plugin lifecycle" step. Apparently the spring package cannot be found as the following error messages appear (I renamed the class as I want my plugin to do something different than in the tutorial later on, but right now except for the class name everything is 1:1 from the tutorial):

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[28,40] package org.springframework.beans.factory does not exist

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[29,40] package org.springframework.beans.factory does not exist

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[31,41] cannot find symbol
symbol: class InitializingBean
public class FWorkLogListener implements InitializingBean, DisposableBean {

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[31,59] cannot find symbol
symbol: class DisposableBean
public class FWorkLogListener implements InitializingBean, DisposableBean {

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[44,4] method does not override or implement a method from a super
type

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[54,4] method does not override or implement a method from a super
type
The spring jar files exist and eclipse finds the dependency (i.e. it displays no error), but when I do atlas-compile or atlas-run I get the mentioned errors.
Any help would be very appreciated, thanks.

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

7 votes
Answer accepted
catworkx GmbH
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.
April 4, 2012

Adding following dependency in your pom.xml should also fix it:

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.6</version>
<scope>provided</scope>
</dependency>

Cheers,

Sebastian

Arne Bergmann April 4, 2012

Thank you, that works as well (and does not leave the bad aftertaste that the previous solution left for me).

Umair Haroon
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.
April 15, 2014

@catWorkXHey I did what you suggested (which looked pretty straightforward), however now I get the following error:

Compilation failure.

error: error reading C:\Users\uh01\.m2\repository\org\springframework\spring-beans\2.5.6\spring-beans-2.5.6.jar; invalid LOC header (bad signature)

I checked the path and it is correct and the .jar file as specified above does exist in the same path, so Im not sure why Im getting this error. Any suggestions?

1 vote
Chris Johnson March 26, 2012

I am getting the same error, with both SDK 3.6.2 and SDK 3.9. I'm pretty sure this worked a couple weeks ago, when i last tried compiling the atlassian-event tutorlal example with SDK 3.6.2.

Chris Johnson March 26, 2012

I was able to get the tutorial and my plugin both to compile using the SDK 3.6.2 by changing the <jira.version> in the pom.xml file.

Original line:

&lt;jira.version&gt;5.0&lt;/jira.version&gt;

Working line:

&lt;jira.version&gt;5.0-beta3&lt;/jira.version&gt;

It's possible to imagine that SDK 3.6.2 does not work with release JIRA 5.0 (not beta), but why SDK 3.9 does not work is beyond me.

Arne Bergmann March 26, 2012

This works! Thank you so much. After changing the version to 5.0-beta3 I was able to compile the plugin with the SDK 3.9.

1 vote
JamieA
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.
March 22, 2012

I don't know much about eclipse, but I suspect that unless you're using m2eclipse, it doesn't read the pom, and maintains dependencies in its own format (.classpath?). I'd check your pom against the one from the tutorial, which is in github iirc.

Arne Bergmann March 22, 2012

I am not trying to compile the plugin with eclipse I'm using atlas-compile for that. I just mentioned eclipse because the eclipse project is generated by "atlas-mvn eclipse:eclipse" from the pom and all the dependencies are correct there (I did not change the eclipse build-path manually). The pom is the same as in the tuturial (double checked with the code from git).

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.
March 22, 2012

Did you try atlas-compile from command line and see what happens?

Arne Bergmann March 22, 2012

console log part two:


P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[28,40] package org.springframework.beans.factory does not exist

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[29,40] package org.springframework.beans.factory does not exist

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[31,41] cannot find symbol
symbol: class InitializingBean
public class FWorkLogListener implements InitializingBean, DisposableBean {

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[31,59] cannot find symbol
symbol: class DisposableBean
public class FWorkLogListener implements InitializingBean, DisposableBean {

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[44,4] method does not override or implement a method from a super
type

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\src\main\java\com\friendshipsystems\jira\plugins\FWorkLogListener.java:[54,4] method does not override or implement a method from a super
type


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Mar 23 12:22:54 CET 2012
[INFO] Final Memory: 61M/548M
[INFO] ------------------------------------------------------------------------

Arne Bergmann March 22, 2012

Ok, apparently my initial question was not verbose enough, sorry about that.

I am using the command line only. I am basically only using eclipse as a text editor. For compilation and test deployment I am only using the command line. So the error message I posted is from running atlas-compile from the command line.

Sorry for not making that clear before.

Here's a complete console log:

P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug>atlas-compile
Executing: "C:\opt\atlassian-plugin-sdk-3.9\apache-maven\bin\mvn.bat" compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building ftimetrackerplug
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [jira:copy-bundled-dependencies]
[INFO] [dependency:copy-dependencies]
[INFO] [jira:compress-resources]
[INFO] [yuicompressor:compress]
[INFO] nb warnings: 0, nb errors: 0
[INFO] [resources:resources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [jira:filter-plugin-descriptor]
[INFO] [resources:copy-resources {execution: virtual-execution}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to P:\eclipseWorkspaceMain\jiraissuetrackerfield\ftimetrackerplug\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

0 votes
Arne Bergmann March 25, 2012

After some help from the Atlassian support I did some tests that unfortunately didn't help until now, but brought up some more information, that might help others with more experience with finding the solution.

In case you haven't figured out by now, I have no experience with maven.

So, even though I installed the Atlassian Plugin SDK I tried to create a settings.xml file in my M2_REPO directory according to https://svn.atlassian.com/svn/public/atlassian/maven2settings/settings.xml.devnet and https://developer.atlassian.com/display/DOCS/Example+settings.xml and tried to set up the tutorial again. The problem remains.

So I took a look at the M2_REPO\repository folder and from what I can say it seems like everything is there. At the path M2_REPO\repository\org\springframework\spring-beans\2.5.6.SEC02 I find the spring-beans-2.5.6.SEC02.jar file which includes the org.springframework.beans.factory package with the two class files in question.

Any ideas why maven does not find these files even though they exist (from what I can tell) at the correct location?

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