tiku01 / oryx-editor

The New Home of the Oryx-Editor
Other
18 stars 8 forks source link

BPMN import only working by copy&paste, file-selector dis-functional #522

Closed tiku01 closed 9 years ago

tiku01 commented 9 years ago

When trying to import an exported BPMN, selecting a file and choosing OK doesn't work. Error message given by UI is "An error occurred while generating the BPMN 2.0 DI XML Serialization". The log-file shows this after the operation:

javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:481)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:199)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)
        at org.oryxeditor.server.BPMN2_0Importer.getJsonFromBpmn20Xml(Unknown Source)
        at org.oryxeditor.server.BPMN2_0Importer.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.xml.sax.SAXParseException; Premature end of file.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:195)
        ... 24 more

If one uses copy&paste to input the same file content into the dialogue-box one gets a result (with the problem reported in https://github.com/tiku01/oryx-editor/issues/521). So is the problem with the file content or with the import-routine?

tiku01 commented 9 years ago

It seems this is the same thing as we fixed for JSON with https://github.com/tiku01/oryx-editor/commit/18e8c655f0715b6e7030b144b6000dc02485b4a9 - attempting a search for "form.items.items[1].getEl().dom.addEventListener('change', function(evt)" here on GitHub (https://github.com/tiku01/oryx-editor/search?utf8=%E2%9C%93&q=form.items.items[1].getEl%28%29.dom.addEventListener%28%27change%27%2C+function%28evt%29) leads to 9 hits in the code. It looks like we need to change the other files accordingly ...

gautamsawala commented 9 years ago

Fixed the event handler that was not importing the file data into the dialog, due to which the error was thrown. Fixed all such event handlers across oryx with #531

tiku01 commented 9 years ago

BPMN still not fixed (i.e. working while using copy&paste but dysfunctional when selecting file ...

tiku01 commented 9 years ago

Seems to work now - despite the content-related import-errors