Hello,
According to this article (https://developer.atlassian.com/display/DOCS/Setting+OSGi+Manifest+Instructions+in+your+Plugin#SettingOSGiManifestInstructionsinyourPlugin-Usingthird-partycode) putting a jar into WEB_INF/lib dictionary does not make the classes inside the jar jira-wide accessible. How can I make it so?
The problem is I have a plugin (version 1) that provides some interfaces (without implementation), that are used by other plugins (version 2) to implement these interfaces. However when I add dependency to plugin v1 inside pom.xml of plugin v2 with provided scope, then the interface cannot be found (class not found exception during atlas-run). When I use compile scope then I get class cast exception as interfaces are loaded by different classloaders.
How can I make to use the provided scope, but force plugin v2 classloader to see the interface?
Thanks in advance,
Marek
Community moderators have prevented the ability to post new answers.
When I upgraded JIRA 3 to 4 I used dirty hack: atlassian-plugins-osgi-2.8.1.jar has list of defaults imports in txt files. I just add my packages to osgi-packages.txt file. It works.
But it is dirty hack. Good way - it is convert plugin.
interesting hack. Never noticed that jar before!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are right. You can add the following arguments to the setenv.bat/setenv.sh
Replace com.myplugin.* accordingly
set JVM_SUPPORT_RECOMMENDED_ARGS=-Datlassian.org.osgi.framework.bootdelegation=sun.*,com.sun.*,com.myplugin.*
Boot delegation occurs when the plugin's class loader delegates to the JVM "boot class loader" to load a class, rather than loading the class itself or delegating to another bundle's class loader. And classes in the WEB-INF/lib are loaded by the JVM boot class loader.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried loading the classes in the v1 plugin using boot delegation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't. I'm a bit new to OSGi framework. Could you share some details how to use boot delegation in Jira? Should I modify setenv.sh/setenv.bat file? And should I include all exported packages or just mine?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try what Radu suggests here?
https://answers.atlassian.com/questions/11656/exchange-data-between-v1-and-v2-plugin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not yet, I'm searching for sollution that does not require reflection. The options I see is to modify plugin v2 classloader to see my JARs in WEB_INF/lib directory or to add my plugin v1 to system bundle like com.google.collect.* classes for example. However I do not know how to apply any of this solution. I would appriciate any hint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.