对于函数调用蜡染不兼容的对象参数(Batik Incompatible object argumen

2019-10-18 13:37发布

我看到下面的错误,而试图在以JSVG面板加载SVG文件。

Exception occurred in target VM: (class: org/apache/batik/bridge/BridgeContext, method: dispose signature: ()V) Incompatible object argument for function call 
java.lang.VerifyError: (class: org/apache/batik/bridge/BridgeContext, method: dispose signature: ()V) Incompatible object argument for function call
    at org.apache.batik.swing.svg.JSVGComponent.createBridgeContext(Unknown Source)
    at org.apache.batik.swing.svg.JSVGComponent.installSVGDocument(Unknown Source)
    at org.apache.batik.swing.JSVGCanvas.installSVGDocument(Unknown Source)
    at org.apache.batik.swing.svg.JSVGComponent$2.run(Unknown Source)
    at org.apache.batik.swing.svg.JSVGComponent.stopThenRun(Unknown Source)
    at org.apache.batik.swing.svg.JSVGComponent.setSVGDocument(Unknown Source)
    at org.netbeans.modules.plantumlnb.SVGImagePreviewPanel.renderSVGFile(SVGImagePreviewPanel.java:48)
    at org.netbeans.modules.plantumlnb.RenderImageThread$1.run(RenderImageThread.java:56)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

下面是相关的代码。

canvas.setSVGDocument(createSVGDocument(new StringReader(imageContent)));

我不知道我在做什么错在这里。 任何帮助表示赞赏。

Answer 1:

我觉得不兼容不在于你的应用程序和蜡染之间,但蜡染和其所需的图书馆之一,其是不存在或存在不同版本之间。 典型的候选人可能使用它,例如XML-apis.jar与其他软件一起进入环境中的XML工具库。 陷入困境的另一种可能性是使用Java版本为包括DOM API类从版本更改为版本,这是太旧了。



文章来源: Batik Incompatible object argument for function call
标签: java batik