jsbml icon indicating copy to clipboard operation
jsbml copied to clipboard

ClassCastException in SBMLReader

Open danv61 opened this issue 1 year ago • 1 comments

The attached xml file triggers the following exception:

java.lang.ClassCastException: class org.sbml.jsbml.xml.XMLNode cannot be cast to class org.sbml.jsbml.Annotation (org.sbml.jsbml.xml.XMLNode and org.sbml.jsbml.Annotation are in unnamed module of loader 'app')

at org.sbml.jsbml.xml.stax.SBMLReader.readXMLFromXMLEventReader(SBMLReader.java:851)

The following warning was also generated: WARN (SBMLReader.java:735) - Starting to read a new annotation element while the previous annotation element is not finished.

Here is the code line in question: annoReader.processAnnotation((SBase) ((Annotation) lastElement).getParent()); // or take the second element in the stack ??

I checked the file with the online SBML validator and it is valid. Ota2015_GDI-integrated.zip

danv61 avatar Oct 29 '24 16:10 danv61

Hi! I just looked into the file and it seems to be the same issue as the related #264

Unfortunately without deeper understanding of your use case it is pretty hard to say what the correct course of action for you would be here.

Schmoho avatar Dec 11 '24 13:12 Schmoho