I'm trying to create an Idea plugin for an app that makes heavy use of the apache xmlbeans libraries.. (SoapUI; http://www.soapui.org). Strangely, I run into problems with xmlbeans which seem to be class-loader related:
- I've put all my jars in a lib directory in my plugin, including all xmlbeans jars and the jars xmlbeans has generated for my xml schemas
- When parsing xml-files with these generated jars, xmlbeans does not find the generated type-information that has been compiled into them unless I explicitely change the current threads context-classloader to the one for my plugin.
-> It seems as if xmlbeans is being instantiated by a classloader that does not have access to these generated jars!? I cant see xmlbeans being included in the idea lib directory (otherwise that would probably explain the problem since the idea classloader wouldn't find my jars.. )
It is not realistic for me to switch contextclassloader every time execution comes into code in my plugin.. how can I work around this?
Ultimately, I would like my plugins ClassLoader to be "reverse".. ie first check in the plugins classpath, then the parent.. (like it is in many j2ee/ear-deployers).. is there an option for this?
(I'm using the 6.0.1 idea release and the latest plugin dev-kit)
Any help is greatly appreciated!