classcastexception thrown by plugin

I've spun my wheels for the past couple of days on this problem so now it's time to ask for help...

My plugin requires a separate utility jar file that has the xercesImpl.jar classes included in it. When my plugin calls (for example) a particular soap send() method in the utility jar this eventually results in a call to javax.xml.parsers.DocumentBuilderFactory.newInstance() which is generating a ClassCastException.

Apparently the conflict is between the xerces.jar that IDEA has and the xercesImpl.jar that is included in the utility jar.

I've tried many variations on classloading, none of which has been successful, but I thought the whole purpose of the plugin classloader was so that this sort of thing doesn't happen. Just in case it was just a misconfiguration problem I put another copy of xercesImpl.jar in the lib dir with my difference.

The few hairs I haven't yet pulled from my head are quickly turning grey, can anyone point me in the right direction?

BTW, this is with IntelliJ-IDEA-4.5.



Comment actions Permalink

Have you tried removing the xerces classes from the utility.jar? Let those classes be found in the xerces.jar provided by IDEA.


Comment actions Permalink

Unfortunately that's not an option. The utility class is really a standalone app that requires the xercesImpl classes. The plugin is an interface to it.

Comment actions Permalink

well I've had some luck, but I really have to call it luck because I stumbled on it. It's not working for the reasons I expect, but it is working. With my classloader in place AND the xercesImpl.jar in the plugin lib it seems happy - The xercesImpl.jar shouldn't be necessary, but for some reason is :( I'll revisit this later as I have another question to post...


Please sign in to leave a comment.