draeger-lab / EscherConverter

A standalone program that reads files created with the graphical network editor Escher and converts them to files in community standard formats.
https://draeger-lab.github.io/EscherConverter/
MIT License
15 stars 10 forks source link

Converting .json file to .sbml and back returns an IllegalArgumentException #36

Closed MariaHei closed 5 years ago

MariaHei commented 5 years ago

When converting a .json file to .sbml and then converting this .sbml file back to .json, the following error is returned: java.lang.IllegalArgumentException: Cannot register layout.

Options are set to default: grafik

Stack trace:

ERROR (Model.java:4689) - An element of type model with the id "Escher_Layout" is already present in this model "Escher_Layout". The new element of type layout will not be added to the model.
25.04.2019 10:36:53 de.zbit.gui.GUITools showErrorMessage --- WARNUNG: java.lang.IllegalArgumentException: Cannot register layout.
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Cannot register layout.
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at javax.swing.SwingWorker.get(Unknown Source)
    at edu.ucsd.sbrg.escher.gui.EscherMapDisplay.lambda$0(EscherMapDisplay.java:62)
    at java.beans.PropertyChangeSupport.fire(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport.firePropertyChange(Unknown Source)
    at javax.swing.SwingWorker$SwingWorkerPropertyChangeSupport$1.run(Unknown Source)
    at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
    at sun.swing.AccumulativeRunnable.run(Unknown Source)
    at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
    at javax.swing.Timer.fireActionPerformed(Unknown Source)
    at javax.swing.Timer$DoPostEvent.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Cannot register layout.
    at org.sbml.jsbml.AbstractSBase.registerChild(AbstractSBase.java:2221)
    at org.sbml.jsbml.ListOf.add(ListOf.java:445)
    at org.sbml.jsbml.ext.layout.LayoutModelPlugin.addLayout(LayoutModelPlugin.java:102)
    at org.sbml.jsbml.ext.layout.LayoutModelPlugin.createLayout(LayoutModelPlugin.java:124)
    at edu.ucsd.sbrg.escher.converter.Escher2SBML.initLayout(Escher2SBML.java:948)
    at edu.ucsd.sbrg.escher.converter.Escher2SBML.convert(Escher2SBML.java:105)
    at edu.ucsd.sbrg.escher.EscherConverter.convert(EscherConverter.java:142)
    at edu.ucsd.sbrg.escher.gui.EscherConverterWorker.doInBackground(EscherConverterWorker.java:63)
    at javax.swing.SwingWorker$1.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at javax.swing.SwingWorker.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
MariaHei commented 5 years ago

This exception occurs for example with the sample file e_coli_core_metabolism.sbml.xml in the data folder.

MariaHei commented 5 years ago

This occurs both when using the GUI and when using the command line.

MariaHei commented 5 years ago

The error can be avoided by renaming Layout identifier in the options: grafik