Community
Participate
Working Groups
Hi, I try to build a feature containing a graphical editor based on Sirius, to be able to install it in an existing RCP application. The problem is that when I try to open an editor containing 'Dot' representations, I have the following exception : [code] java.io.IOException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source) at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source) at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source) at org.eclipse.sirius.diagram.ui.tools.api.figure.SVGFigure.loadDocument(SVGFigure.java:90) at org.eclipse.sirius.diagram.ui.tools.api.figure.SVGFigure.getDocument(SVGFigure.java:105) at org.eclipse.sirius.diagram.ui.tools.api.figure.BundledImageFigure.updateDocumentColors(BundledImageFigure.java:194) at org.eclipse.sirius.diagram.ui.tools.api.figure.BundledImageFigure.updateColors(BundledImageFigure.java:147) at org.eclipse.sirius.diagram.ui.tools.api.figure.BundledImageFigure.refreshFigure(BundledImageFigure.java:311) at org.eclipse.sirius.diagram.ui.tools.api.figure.BundledImageFigure.createImageFigure(BundledImageFigure.java:119) at org.eclipse.sirius.diagram.ui.internal.edit.parts.BundledImageEditPart.createNodeShape(BundledImageEditPart.java:133) at org.eclipse.sirius.diagram.ui.internal.edit.parts.BundledImageEditPart.createNodeFigure(BundledImageEditPart.java:189) at org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart.createFigure(ShapeNodeEditPart.java:90) [/code] If I don't misunderstood, my plugins included in this feature depend on the Sirius plugins, which depend themself on the Apache Batik plugins. But the Batik plugin references the Apache Xerces driver as an optional Import-Package : [code] Bundle-SymbolicName: org.apache.batik.dom (...) Import-package: org.w3c.dom,org.apache.xerces.parsers;resolution:=optional [/code] Is it normal that the Sirius plugin doesn't depend on the Xerces plugin to ensure that the optional package is resolved ? Regards, Jonathan
Note that RCP is not a primary target for Sirius, and so be aware that various parts of Sirius depend on the workspace and workbench. See various aspects of using Xerces in Eclipse in the "Xerces in Eclipse" wiki page: https://wiki.eclipse.org/Orbit/Xerces_in_Eclipse . Note that "It's not always easy" as said in the page.
I have a workaround : I have create my own plugin containing the jar provided by Orbit to offer the needed packages. It's not the best solution I think but when I just add the dependencies to the Orbit plugins in my plugin, it doesn't work. The Apache Xerces plugin from Orbit is well included during my feature installation, but the driver is still not found.
Same here with the Modeling product testing EcoreTools2 and UML designer on a Mac. What do you mean when you say "Note that RCP is not a primary target for Sirius"?
Jonathan , we are trying to narrow down the cases where Eclipse does not find a xerces parser. Were you building on a Mac ? if so which version with which JVM ? We also need to figure out what "harm" could be done if explicitely requiring the Xerces bundles in the Sirius features (or have a specific "required third parties" feature) accross the JVM range we support (from 1.6), os environment(windows, linux and macos) and Eclipse platforms (3.8 and 4.4.)..
(In reply to Charlie Mordant from comment #3) > What do you mean when you say "Note that RCP is not a primary target for > Sirius"? Well, for example org.eclipse.sirius.ui depends on org.eclipse.ui.ide which defines the 'project nature' extension point, but that plug-in is not part of RCP (https://wiki.eclipse.org/RCP_FAQ#What_is_included_in_the_Rich_Client_Platform.3F). There are probably others. Basically we currently assume we run under a mostly standard Eclipse IDE and may depend on stuff from that context which are not available in a pure/minimal RCP setting.
Sorry for the delay, but to answer to your question we do not build on Mac, only on Windows and Linux, for 32 and 64b platforms. And we use a JVM 1.7.0_17. Regards
I currently reproduce the issue on my dev environment: Luna SR1 Mac OS Yosemite java.vm.name=Java HotSpot(TM) 64-Bit Server VM java.vm.specification.name=Java Virtual Machine Specification java.vm.specification.vendor=Oracle Corporation java.vm.specification.version=1.7 java.vm.vendor=Oracle Corporation java.vm.version=24.71-b01 It same I have the same issue than reported in https://bugs.openjdk.java.net/browse/JDK-8017491 In some situations I am able to load and see SVG images on my diagrams, but in other cases it fails to open an existing diagram with SVG Images (define in the VSM or user defined, and when using the new Ecore Modeling Project which opens a diagram). I observed some difference between working and KO situations: . KO: Thread.currentThread().getContextClassLoader() is null and . OK: Thread.currentThread().getContextClassLoader() is a org.eclipse.osgi.internal.framework.ContextFinder If I add the following draft workaround code in SVGImageFigure, it allows to avoid the error: if (Thread.currentThread().getContextClassLoader() == null) { Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); } document = factory.createDocument(uri); When I run the same scenario on my previous machin (Win8), I always have a context class loader, but I have detected a difference between my two computers: . On windows, the current thread is a ModalContext$ModalContextThread . On Mac OS, . when it fails, in the stack I can SEE that the current thread is the AppKit main thread, (sometimes I see org.eclipse.jface.operation.ModalContext.runInCurrentThread where on Win8 I have a ModalContextThread), . when it works (reopen a runtime with an already open Diagram with svg), there is no Modal context in the stack, and the Thread.currentThread().getContextClassLoader() is a org.eclipse.osgi.internal.framework.ContextFinder
See https://git.eclipse.org/r/35319 . Avoid several NPE when transcoder is null (side effects of the SAXParser not found error) . If the SaxParser is not found and if the current thread context class loader is null, retry once with the class loader of SVGImageFigure.
The proposed fix has been merged on master for 2.0.0, see commit afbfffda43118dc4dc244f64b5eaa97df8a093c0
Great news ! I will wait the 2.0.0 release (October 24, 2014 if I don't make a mistake) and confirm the correction.
*** Bug 446928 has been marked as a duplicate of this bug. ***
With a nightly build which contains the submitted fix, I do not get the exception anymore and the diagram shows my svg image.
Well done, thanks! I'll test this patch as sooner as possible
Verified with Sirius 2.0.0-S20141024-041312
Available in Sirius 2.0.0.
*** Bug 441755 has been marked as a duplicate of this bug. ***
Hi, we applied the same kind of fix in our product based on GMF. Some users based on the last Mac OS version, El Capitan, are complaining about the issue to be back. Do you encounter the issue back too?
(In reply to Aurelien Pupier from comment #17) > Hi, > > we applied the same kind of fix in our product based on GMF. Some users > based on the last Mac OS version, El Capitan, are complaining about the > issue to be back. Do you encounter the issue back too? Hi Aurélien, I currently use El Capitan and I do encounter the issue back. I do not reproduce the issue (with Mars or Neon as target platform) and for the moment no user complained about the issue to be back. Regards; Maxime
It seems that a "not" disappeared from my comment. I do NOT encounter the issue back. (In reply to Maxime Porhel from comment #18) > (In reply to Aurelien Pupier from comment #17) > > Hi, > > > > we applied the same kind of fix in our product based on GMF. Some users > > based on the last Mac OS version, El Capitan, are complaining about the > > issue to be back. Do you encounter the issue back too? > > Hi Aurélien, > > I currently use El Capitan and I do NOT encounter the issue back. I do not > reproduce the issue (with Mars or Neon as target platform) and for the > moment no user complained about the issue to be back. > > Regards; > > Maxime
New Gerrit change created: https://git.eclipse.org/r/98911