OSGi classloader issues

Hi Geeks,

I am very new to OSGi.

I am developing a JIRA plugin, suppose A which depends on libraries, suppose B-1.0 and C-1.0. Now If the library C-1.0 depends on library B-2.0 (Note: the different version of library B). So my plugin has two different versions of the library B in its classpath. Now, How can I handle this situation ?

As I studied from last 4-5 days about OSGi that it creates a classloader for each plugin in the JIRA application, so that dependency version mismatch do not occur between plugins. But What would a developer do If a plugin itself needs two different versions of a library jar ?

Can I create two different classloaders in a single plugin through OSGi, say one for package X and another one for package Y ?

Please help me in any of the above scenarios or point me to the right direction.

Thanks in advance.

1 answer

0 vote

Can I create two different classloaders in a single plugin through OSGi, say one for package X and another one for package Y ?

I'm afraid OSGi doesn't help you with this. In an OSGi container every bundle (and an Atlassian plugin is a bundle in OSGi land) gets its own bundle classloader but no more.

Could you be more explicit with your examples? Apart from changing A to compatible with B-2.0 I can't see a way to solve your problem.


Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Friday in Off-topic

Friday Fun: Riddle me this

Happy Friday, Funmakers! We had a Community Team offsite in Austin this week, and my mind feels primed for thinkin' from all the brainstorming we did!  So, this week's Friday Fun thread w...

212 views 24 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you