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 votes

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
Community showcase
Posted Tuesday in United States

Topic Tuesday: What's your favorite topic?

Good morning All, Our goal is to get you into the habit of while enjoying your favorite morning drink you are checking the NOVA "space" for topics and comments. Your input is really needed and...

60 views 4 0
View post

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