Managing dependencies across plugins and main app.
95 views
Skip to first unread message
Alex Sukstansky
unread,
Mar 1, 2012, 9:06:51 AM3/1/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jspf
In JSPF FAQ there is a statement that if plugins are packed in jars
with all required dependencies included, then each of that plugins
will have its own separate class-loading realm to isolate dependencies
from other plugin.
I mean if of plugin uses some-lib-1.0.jar and other plugin uses
incompatible some-lib-1.2.jar there will be no problems at all. But
what about dependencies of a "main app"? How to isolate plugins from
classes loaded in "parent" classloader? Thanks in advance.
Alex.
sukst...@gmail.com
unread,
Mar 1, 2012, 9:19:33 AM3/1/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to js...@googlegroups.com
Let me explain steps I've made to encounter problem. My App uses spring 3.0.6. I've created jspf-plugin and build uber-jar using maven shade plugin. So far so good... Everything works perfectly fine. But after I've added spring 3.1.x dependency into my plugin project I've got
java.lang.IncompatibleClassChangeError: Implementing class at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:128) at org.codehaus.classworlds.DefaultClassRealm.loadClassDirect(DefaultClassRealm.java:242) at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:222) at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:145) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at net.xeoh.plugins.base.impl.classpath.ClassPathManager.findSubclassesFor(ClassPathManager.java:216) at net.xeoh.plugins.base.impl.classpath.loader.FileLoader.locateAllPluginsAt(FileLoader.java:134) at net.xeoh.plugins.base.impl.classpath.loader.FileLoader.loadFrom(FileLoader.java:105) at net.xeoh.plugins.base.impl.classpath.ClassPathManager.addFromLocation(ClassPathManager.java:140) at net.xeoh.plugins.base.impl.PluginManagerImpl.addPluginsFrom(PluginManagerImpl.java:127) at com.xxxxxxxxx.service.EmailMessageStrategyTest.testLoadingPlugin(EmailMessageStrategyTest.java:69)
Sorry, if my question is too "noobie", but never the less :)