class loader issue with xmlbeans

Hi,

We have developed a plugin and it has a schema jar which depends on xmlbeans. Though we have added xmlbeans jar to plugin lib folder, xmlbeans jar is getting loaded from idea lib folder. So we are getting classcast exception with substitute method.

Please help how to to resolve this.

 

0

Is it possible for you to re-create your jar with bundled xmlbeans?

0
Avatar
Permanently deleted user

I tried re-creating the schema jar with idea lib xmlbeans jar and also placing this xmlbeans jar in plugin lib folder but that did not work.

We have this schema usage at only one place so tried setting like below  ( My plugin code is written in kotlin script)

val originalLoader = Thread.currentThread().contextClassLoader
Thread.currentThread().contextClassLoader = this.javaClass.classLoader

and resetting in the finally block

Thread.currentThread().contextClassLoader = originalLoader



0

请先登录再写评论。