Classloader Problem

Hi,
I'm using the TFS API from http://www.microsoft.com/en-us/download/details.aspx?id=22616 to develop a plugin.
If i set the jar as module dependency of my plugin, i will get an exception if i am using some function in the containing jar.
But if i set this jar to classpath of the intellij IDEA Plugin SDK, everything works just fine for me.
I cant deploy my plugin without setting it as dependency for my plugin, so what can i do to get this running?

[   8769]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(605,73),absolute(2357,159),button=1,modifiers=Button1,clickCount=1] on frame0 java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory      at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)      at com.microsoft.tfs.util.xml.JAXPUtils.newDocumentBuilderFactory(JAXPUtils.java:84)      at com.microsoft.tfs.util.xml.JAXPUtils.newDocumentBuilderFactory(JAXPUtils.java:52)      at com.microsoft.tfs.util.xml.DocumentBuilderCache.createNewBuilder(DocumentBuilderCache.java:144)      at com.microsoft.tfs.util.xml.DocumentBuilderCache.takeDocumentBuilder(DocumentBuilderCache.java:101)      at com.microsoft.tfs.util.xml.DOMCreateUtils.newDocumentNS(DOMCreateUtils.java:163)      at com.microsoft.tfs.util.xml.DOMCreateUtils.newDocumentNS(DOMCreateUtils.java:136)      at com.microsoft.tfs.core.clients.workitem.internal.WITRequestIDHeaderProvider.getSOAPHeader(WITRequestIDHeaderProvider.java:48)      at com.microsoft.tfs.core.ws.runtime.client.SOAPRequestEntity12.writeRequest(SOAPRequestEntity12.java:77)      at com.microsoft.tfs.core.ws.runtime.client.BufferedSOAPRequestEntity.ensureRequestIsBuffered(BufferedSOAPRequestEntity.java:133)      at com.microsoft.tfs.core.ws.runtime.client.BufferedSOAPRequestEntity.getContentLength(BufferedSOAPRequestEntity.java:65)      at com.microsoft.tfs.core.httpclient.methods.EntityEnclosingMethod.getRequestContentLength(EntityEnclosingMethod.java:391)      at com.microsoft.tfs.core.httpclient.methods.EntityEnclosingMethod.addContentLengthRequestHeader(EntityEnclosingMethod.java:474)      at com.microsoft.tfs.core.httpclient.methods.EntityEnclosingMethod.addRequestHeaders(EntityEnclosingMethod.java:436)      at com.microsoft.tfs.core.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2596)      at com.microsoft.tfs.core.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2451)      at com.microsoft.tfs.core.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1313)      at com.microsoft.tfs.core.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:508)      at com.microsoft.tfs.core.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:197)      at com.microsoft.tfs.core.httpclient.HttpClient.executeMethod(HttpClient.java:464)      at com.microsoft.tfs.core.httpclient.HttpClient.executeMethod(HttpClient.java:376)      at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:588)      at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473)      at ms.tfs.workitemtracking.clientservices._03._ClientService5Soap12Service.getMetadataEx2(_ClientService5Soap12Service.java:863)      at com.microsoft.tfs.core.clients.workitem.internal.metadata.Metadata.update(Metadata.java:512)      at com.microsoft.tfs.core.clients.workitem.internal.metadata.Metadata.update(Metadata.java:490)      at com.microsoft.tfs.core.clients.workitem.internal.WITContext.<init>(WITContext.java:109)      at com.microsoft.tfs.core.clients.workitem.WorkItemClient.getContext(WorkItemClient.java:423)      at com.microsoft.tfs.core.clients.workitem.WorkItemClient.query(WorkItemClient.java:589)      at control.Controller.getProductBacklog(Controller.java:71)      at control.PluginActionListener.actionPerformed(PluginActionListener.java:37)      at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:255)      at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)      at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)      at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:226)      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)      at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:100)      at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:512)      at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)      at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)      at java.awt.Component.processMouseEvent(Component.java:6297)      at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)      at java.awt.Component.processEvent(Component.java:6062)      at java.awt.Container.processEvent(Container.java:2039)      at java.awt.Component.dispatchEventImpl(Component.java:4660)      at java.awt.Container.dispatchEventImpl(Container.java:2097)      at java.awt.Component.dispatchEvent(Component.java:4488)      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)      at java.awt.Container.dispatchEventImpl(Container.java:2083)      at java.awt.Window.dispatchEventImpl(Window.java:2489)      at java.awt.Component.dispatchEvent(Component.java:4488)      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:674)      at java.awt.EventQueue.access$400(EventQueue.java:81)      at java.awt.EventQueue$2.run(EventQueue.java:633)      at java.awt.EventQueue$2.run(EventQueue.java:631)      at java.security.AccessController.doPrivileged(Native Method)      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)      at java.awt.EventQueue$3.run(EventQueue.java:647)      at java.awt.EventQueue$3.run(EventQueue.java:645)      at java.security.AccessController.doPrivileged(Native Method)      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)      at java.awt.EventQueue.dispatchEvent(EventQueue.java:644)      at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:673)      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:494)      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:333)      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) [   8770]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 12.0.4  Build #IC-123.169 [   8770]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.6.0_39 [   8770]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) 64-Bit Server VM [   8771]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Sun Microsystems Inc. [   8771]  ERROR - com.intellij.ide.IdeEventQueue - OS: Linux [   8771]  ERROR - com.intellij.ide.IdeEventQueue - Last Action: 0

1 comment

Hey, I come across almost same situation as you posted, could you share your solution ?

0

Please sign in to leave a comment.