Is there a simple example project for embedding the plugin framework?

Jason Levine February 28, 2012

I'm struggling to figure out the process for successfully embedding the Atlassian Plugin Framework, and am interested in whether there are any simple example projects out there that use it. It doesn't matter to me if it's an officially-blessed Atlassian project or something a third-party developer has put online -- I'd just love to see some code so I can better understand what I'm missing.

Note that I've followed the Quick Start guide, and have gotten as far as building a plugin container app, as well as a simple plugin to deploy within the app. But I can't get any data shared from the app into the plugin (tons of proxy-based NullPointerExceptions), nor can I figure out how to move from the now-deprecated methods that are mentioned in the Quick Start guide to the new methods that replace them.

Am I up a creek on this?

Thanks a ton, in advance!

1 answer

1 vote
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2012

I know a few people have successfully run the plugin framework standalone, but for the life of me I can't find any links to prove it.

As an alternative, you could try looking at the Atlassian RefApp, which is a bare bones implementation of a web app with the plugin framework + some other bits and pieces (like SAL): https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/refapp/atlassian-refapp/2.9.1/

Jason Levine February 28, 2012

Thanks, Joseph -- I'll take a look at that. You linked to the v2.9.1 one -- should I be looking at v2.12.1 instead, though?

https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/refapp/atlassian-refapp/2.12.1/

Likewise, do you have any good ideas for how to debug plugins in an IDE? As they're loaded from JARs by the plugin container app, they're not exactly debuggable very easily... which is making hunting down the NPEs that I'm experiencing VERY hard. All I know at this point is that it's occurring on line 128 of com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar, in the ContextClassLoaderSettingInvocationHandler.invoke method -- the specific line is:

thread.setContextClassLoader(this.service.getClass().getClassLoader());

and I have no real way to figure out which object is throwing the NPE...

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 29, 2012

Any version of the refapp should be useful. Sorry for not giving you a link to the latest one- I just scrolled to the bottom of the parent directory and picked the highest number I could find. :-)


Debugging the plugin will depend on the host app's support for debugging. The Atlassian products all support a development mode that can start up a standard debugger that IDEs can connect to to debug plugins or the host application itself. (See atlas-debug)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events