Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Can't open file, error "content is not allowed in prolog"

+1 vote

I've been using the yEd graph editor for a particular project, having spent a very long time on the file in question.  Today, I went to open the file and was met with the following error:

y.H.B.B.b: SAX error: Content is not allowed in prolog.

at com.yworks.A.B.G.A.T$H.ā(Unknown Source)

at com.yworks.A.B.G.A.T.ā(Unknown Source)

at com.yworks.A.B.G.A.P.ā(Unknown Source)

at y.H.G.ā(Unknown Source)

at y.B.A.M.Đ(Unknown Source)

at y.B.h.č(Unknown Source)

at y.B.h.ā(Unknown Source)

at y.B.h.ă(Unknown Source)

at com.yworks.A.B.Z.ă(Unknown Source)

at com.yworks.A.B.Z.ā(Unknown Source)

at com.yworks.A.K.P.ā(Unknown Source)

at com.yworks.A.K.P.ā(Unknown Source)

at com.yworks.A.K.G.ā(Unknown Source)

at com.yworks.A.K.G.ą(Unknown Source)

at com.yworks.A.yEd$2.run(Unknown Source)

at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)

at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)

at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)

at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)

at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)

at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)

at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)

at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)

at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)

at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)

at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)

at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)

at com.yworks.A.C.A.ā(Unknown Source)

at com.yworks.A.C.A.ā(Unknown Source)

... 28 more

From what I gather from this forum, it seems my file has been corrupted somehow (I tried editing it in Notepad++ but the file looked completely incomprehensible, just a bunch of random characters, not at all like an XML file).  For the life of me I can't imagine how that would have happened.  I haven't updated anything, touched the file in any way, and didn't do anything different with the file than what I've done every week for the past several months.

Anyways, here is the file.  If anybody can help me fix the problem or recover any data I'd be tremendously grateful, I'd be pretty devastated to lose all that work and would pay money to recover it.  I am running Version 3.20.1 of the graph editor on Java version 13.0.2, and my OS is Windows 10 64bit.  

in Help by (140 points)

1 Answer

+1 vote
The file you linked is actually a corrupted PDF document and not a yEd GraphML file at all. Unfortunately, it is not possible to recover a GraphML file from a PDF document, much less a corrupted one.
by [yWorks] (140k points)
Thanks for responding.  I'm not sure how that's possible.  This is the exact same file I've been working with and I've done nothing to it other than edit it with the graphical editor.  Windows is still associating it with yEd as a .graphml file type.

Even if I can't recover anything, is there anything I should be avoiding in the graph editor that could have caused this, to prevent this from happening in the future?  It must have been something while using the editor, I'm 100% certain I haven't touched this file except to edit it with that software.  The only thing I can think of is that I might have copied/pasted text from a different program into one of the labels from last session, could that possibly cause some sort of parsing issue?

Re.:

Windows is still associating it with yEd as a .graphml file type.

Windows file association is done through the file name ending only. E.g. if you rename an Microsoft Word document like "sample.doc" to "sample.graphml", Windows will associate the renamed file with yEd - even though yEd cannot handle Word documents in any way.

Re.:

Even if I can't recover anything, is there anything I should be avoiding in the graph editor that could have caused this, to prevent this from happening in the future? It must have been something while using the editor, I'm 100% certain I haven't touched this file except to edit it with that software.

yEd will never accidentally save a diagram as a PDF document. This could only have happened, if you explicitly exported (i.e. you used "File" -> "Export") your diagram as a PDF document. However, even if you did that, it is not possible to accidentally overwrite a "*.graphml" file with a yEd created PDF document because yEd will always append the appropriate file name suffix for the chosen export format (i.e. when you export a diagram to PDF and you choose "my.graphml" as target file name, yEd will actually create a file named "my.graphml.pdf"). There is no way to prevent yEd from enforcing the proper file name suffix.

Moreover, the contents of your corrupted file start with %PDF-1.7 which means that the original document adhered to PDF specification version 1.7. yEd is not able to create PDF documents that adhere to specification version 1.7, yEd always creates PDF documents that adhere to specification version 1.4.

I am afraid, the only explanation for your file being a PDF document is that you actually renamed or copied an existing PDF document to your GraphML file.

Re.:

The only thing I can think of is that I might have copied/pasted text from a different program into one of the labels from last session, could that possibly cause some sort of parsing issue?

No. It is not possible that copying any kind of text into a yEd diagram could result in a GraphML file to be transformed into a corrupted PDF document.

Legal Disclosure | Privacy Policy
...