MF handling of duplicate libraries for plugins

8 views
Skip to first unread message

King Lung Chiu

unread,
Dec 23, 2013, 1:18:50 AM12/23/13
to medi...@googlegroups.com
(Thought I should make a new post for these questions (pulled from my
other post), as they're general to the way MF works, rather than to my
specific plugin.)

If we install a plugin with the library it depends on, eg:

plugin.module.add :class my.Module :path /plugins/myplugin.jar :lib
/libs/library.jar

and if that same library is also used by MF and comes in aserver.jar:

1) When MF runs the plugin, does it use the library jar I supplied, or
does it use the ones from aserver.jar?

2) If by default it uses the ones in aserver.jar, is there a way to
tell MF to use the one I supplied?

3) If the ones in aserver.jar always takes precedence and we cannot
override that:

a) Should we compile our plugin as Java 6 or Java 7 code to remain
compatible with the MF supplied classes (v045)?

b) What do we do if the classes we need are obfuscated (hence "class
not found")?

Thanks a lot, cheers,

King

Jason Lohrey

unread,
Dec 27, 2013, 6:11:25 PM12/27/13
to King Lung Chiu, medi...@googlegroups.com
On 23 Dec 2013, at 5:18 pm, King Lung Chiu <kinglu...@gmail.com> wrote:

(Thought I should make a new post for these questions (pulled from my
other post), as they're general to the way MF works, rather than to my
specific plugin.)

If we install a plugin with the library it depends on, eg:

plugin.module.add :class my.Module :path /plugins/myplugin.jar :lib
/libs/library.jar

and if that same library is also used by MF and comes in aserver.jar:

1) When MF runs the plugin, does it use the library jar I supplied, or
does it use the ones from aserver.jar?


It uses the one on aserver.jar first, generally to stop people overriding symbols and bypassing server security .. although this appears to be somewhat annoying, and we might need to relax/change that behaviour and look locally first before looking in aserver.jar — in hindsight, it’s problematic.


2) If by default it uses the ones in aserver.jar, is there a way to
tell MF to use the one I supplied?

No there is not… unless you create your own class loader, which means the above effort to stop people replacing symbols can be bypassed anyway.

However, many of the symbols in MF are obfuscated, so generally this is not a problem.



3) If the ones in aserver.jar always takes precedence and we cannot
override that:

 a) Should we compile our plugin as Java 6 or Java 7 code to remain
compatible with the MF supplied classes (v045)?

If you end up referring to symbols in aserver.jar, then you should compile against 1.6 to ensure they match.


 b) What do we do if the classes we need are obfuscated (hence "class
not found”)?

Mmm.. that’s going to be tricky to get around - I think we need to change the load order of the class loader to look locally first, then look up in the server…



Thanks a lot, cheers,

King

--
You received this message because you are subscribed to the Google Groups "mediaflux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediaflux+...@googlegroups.com.
To post to this group, send email to medi...@googlegroups.com.
Visit this group at http://groups.google.com/group/mediaflux.
For more options, visit https://groups.google.com/groups/opt_out.

JASON LOHREY
Chief Technical Officer


ARCITECTA
5/26-36 High Street, Northcote
Victoria, Australia 3070
http://www.arcitecta.com
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email or messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Arcitecta shall be understood as neither given nor endorsed by it.

Reply all
Reply to author
Forward
0 new messages