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] (161k 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.

Hi, I have the same problem. Yes, is possible! I was working on it, i did save and the next time when i tried to open it, i've got the same error. How is possible?

How is possible?

The "Content is not allowed in prolog" error message means that a XML file does not adhere to the XML specification. There can be many reasons for this. It does not necessarily mean that a GraphML file has be overwritten with PDF content.

The "it is not possible" statement in my previous comment only applies to the idea that overwriting a GraphML file with PDF content could be done with yEd.

As you mentioned yourself, you did save and the next time you tried to open it, the file was corrupted. So, you do not know what happened in between. Maybe you accidentally replaced the file with another one, maybe anti-virus software corrupted the file, ... There is no way for us to determine what went wrong.

I have similar experience. Unlike the file provided by OP, mine still has the graphml parts.
This happens when I work on the file on another computer. Then, open the file from another computer.

The file can be downloaded here [broken link removed].
Unfortunately, your download link does not work. How large is your file? Maybe you can upload it here.
Hi, this is the link.

[link removed]

I am not sure what happened, but the start of your file got overwritten with parts of an Oasis OpenDocument.

There was still some graph information remaining, though. I extracted the data and added some dummy data to get a valid GraphML file again.

Oasis OpenDocument, I have googled it and I am sure that I have never used it.
I open the file that you extracted. Over 70-80% of the diagram is no longer there.

Still not sure what is the actual cause.

Thank you for the help. I learn that I can do something to the file and make it usable again (although with some loss).
Legal Disclosure | Privacy Policy
...