Plugin that works in debug sdk does not work as a packaged jar

Nicholas Lun January 23, 2013

I've developed a plugin containing a macro using the atlassian sdk and eclipse. Using atlas-run I've tested my plugin and it works fine.

But, if I try to install the packaged jar version of it on another confluence system (same version as I was developing on), I get "webpage not found" everytime it tries to load an action that is included in the plugin.

I used atlas-package, and the tried to upload the plugin to the confluence system. Is this the correct way to do it?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Nicholas Lun January 23, 2013

So I figured out the reason that the debug version works and release version did not is that for some reason the debug version expects that a url have "/confluence/" before your action, while the release version does not. Thus, a different url leading to the right place in each confluence system is obviously going to lead to a problem.

edit: as per Andy's comments. The lesson here is to always use the context path to avoid headaches!

Andy Brook [Plugin People]
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.
January 23, 2013

A plugin developer should always use the contextpath, it may be empty but users can change this :)

0 votes
Andrzej Pasterczyk
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.
January 23, 2013

Well, atlas-package seems 100% correct. You may try atlas-clean to wipe out everything and then atlas-run to rebuild your plugin and launch it on clean environment. Maybe then you'll experience the same issue and will be able to trace the cause.

Andy Brook [Plugin People]
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.
January 23, 2013

yep, you cant rely on mvn install to 'just work' every time, I see seemingly successful builds (but broken). The clue I see is that mvn install generates a JAR that is clearly half the size it should be (generally fails to deploy). A mvn clean install always works.

Nicholas Lun January 23, 2013

I can confirm that after a clean, my dev version works fine.

Nicholas Lun January 23, 2013

just to be clear, what I meant by my previous comment was that my dev version (using atlas-run) is fine, but trying to package the jar and install it on another confluence system still does not work.

0 votes
Andy Brook [Plugin People]
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.
January 23, 2013

Perhaps if you turn on logging in Confluence, you may find helpful information in the log, usually a failing plugin does not fail quietly.

Nicholas Lun January 23, 2013

The logs say that there isn't action mapped to the one I called. But I can't understand why it can find it in my debug version, but not my release version.

Weirder still, one of my other declared actions is fine, where as this one is not. I define both in the atlassian-plugin.xml in the same way except for the namespace, class and name fields.

Andrzej Pasterczyk
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.
January 23, 2013

might sound stupid but those are things that I'd check:

  • check if there's anything in the log before that (right after your plugin is loaded)
  • are there any differences in Confluence version that you're running
  • are there any plugins that are only on one of the instances but not on the other (sometimes could cause conflicts)
  • are you sure you're uploading the correct JAR (same as on your dev instance, taken from target folder) - easiest way to find out is to bump up version number, package and upload new one
TAGS
AUG Leaders

Atlassian Community Events