NullPointerException in reaction.getDerivedUnits with JSBML-v1.3

6 views
Skip to first unread message

Matthias König

unread,
Dec 14, 2017, 7:30:46 AM12/14/17
to jsbml-development
Hi all,
I just tried to update to JSBML-v1.3. When trying to getDerivedUnits on some reactions I get now a NullPointerException.
A minimal example is attached.

Also the getDerivedUnits should return "invalid" not null if the derivedUnits cannot be calculated. This is at least the case for other models,
but strangely not for the attached model.


```
SBMLDocument Level 2 Version 4
reaction [ id="HXT" name="HXT" reversible="true"]
null
null

...

reaction [ id="G3PDH" name="G3PDH" reversible="false"]
null
null
reaction [ id="Glycogen_Branch" name="Glycogen Branch" reversible="false"]
Exception in thread "main" java.lang.NullPointerException
    at org.sbml.jsbml.util.converters.ExpandFunctionDefinitionConverter$3.accepts(ExpandFunctionDefinitionConverter.java:229)
    at org.sbml.jsbml.AbstractTreeNode.filter(AbstractTreeNode.java:361)
    at org.sbml.jsbml.AbstractTreeNode.filter(AbstractTreeNode.java:352)
    at org.sbml.jsbml.AbstractTreeNode.filter(AbstractTreeNode.java:344)
    at org.sbml.jsbml.util.converters.ExpandFunctionDefinitionConverter.replaceAll(ExpandFunctionDefinitionConverter.java:220)
    at org.sbml.jsbml.util.converters.ExpandFunctionDefinitionConverter.access$000(ExpandFunctionDefinitionConverter.java:59)
    at org.sbml.jsbml.util.converters.ExpandFunctionDefinitionConverter$2.accepts(ExpandFunctionDefinitionConverter.java:172)
    at org.sbml.jsbml.AbstractTreeNode.filter(AbstractTreeNode.java:361)
    at org.sbml.jsbml.AbstractTreeNode.filter(AbstractTreeNode.java:374)
    at org.sbml.jsbml.util.converters.ExpandFunctionDefinitionConverter.expandFunctionDefinition(ExpandFunctionDefinitionConverter.java:142)
    at org.sbml.jsbml.AbstractMathContainer.getDerivedUnitDefinition(AbstractMathContainer.java:185)
    at org.sbml.jsbml.AbstractMathContainer.getDerivedUnits(AbstractMathContainer.java:229)
    at org.sbml.jsbml.Reaction.getDerivedUnits(Reaction.java:581)
    at org.cy3sbml.oven.UnitJSBMLTest.main(UnitJSBMLTest.java:20)

```

Best M
UnitJSBMLTest.java
yeast_glycolysis.xml

Matthias König

unread,
Dec 14, 2017, 8:13:27 AM12/14/17
to jsbml-development
I see the same issue with 21 models of the sbml-test-suite-v3.3.0.
See list of test cases in screenshot


Auto Generated Inline Image 1

Nicolas Rodriguez

unread,
Dec 14, 2017, 11:29:13 AM12/14/17
to jsbml-de...@googlegroups.com

Good catch, it should be corrected now on github. It turned out to be a TODO left in the code related to functionDefinition which body is only one of the arguments. I thought only Lucian would created such function but it seems Copasi is doing it as well.

How did you come to test version 1.3 when there was no announcement yet ? Was it an automatic maven update ?

Anyway, should I do a 1.3.1 release and potentially delete the 1.3 or should I try to replace 1.3 as we were still kind in the preparation phase of the release ?

What do you think ?

Nico

--
You received this message because you are subscribed to the Google Groups "jsbml-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsbml-developm...@googlegroups.com.
To post to this group, send email to jsbml-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsbml-development/4c662029-f1a2-4745-910d-4ed00796ecd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Rodriguez

unread,
Dec 15, 2017, 6:19:51 AM12/15/17
to jsbml-de...@googlegroups.com

Hello everybody,

So I will do a 1.3.1 release on Monday/Tuesday with a proper announcement. In the meantime those who want can give it a try to the 1.3 release to see if you find some more problems.

With maven, I have updated the 1.3-SNAPHOT this morning, so it does contain the fix for ExpandFunctionDefinitionConverter reported by Matthias. You can also use the 1.3 but this one does not contain the fix. Otherwise, you can download the 1.3 jar from github or sourceforge.

You can have a go at testing the offline validator as well, I put a detailed status on https://github.com/sbmlteam/jsbml/wiki/Offline-validator-status.

cheers,

Nico

Matthias König

unread,
Dec 18, 2017, 5:43:27 AM12/18/17
to jsbml-development
Hi Nico,
I am following the changes in the github repository and saw the release on github. I thought this was already the official release.

Thanks for the fix. Unfortunately, I can't test it yet.
Could you update the version in the repository to 1.4-SNAPSHOT?
I can't find a way to include the bugfix with the the repository still being at version 1.3. The reason is that as soon as I specify the 1.3 dependency in the pom file the maven build is using the 1.3 version from
https://mvnrepository.com/artifact/org.sbml.jsbml/jsbml-core (which does not include the bugfix)
And there seems no way to force the usage of my local maven repository (which are build from the github source with bugfix).
With the SNAPSHOT it just takes the latest build version and would allow me to use the version from source.

Or is there any way to force which dependency comes from which repository in maven?
Sorry, I am not an expert with maven.

Best M


To unsubscribe from this group and stop receiving emails from it, send an email to jsbml-development+unsubscribe@googlegroups.com.
To post to this group, send email to jsbml-development@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "jsbml-development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsbml-development/AlzHCwHdoCA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsbml-development+unsubscribe@googlegroups.com.
To post to this group, send email to jsbml-development@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsbml-development/bd8b651a-ab37-d6ca-af60-d597d18e12d7%40ebi.ac.uk.

For more options, visit https://groups.google.com/d/optout.



--
Dr. Matthias König
Junior Group Leader LiSyM - Systems Medicine of the Liver
Humboldt-University Berlin, Institute of Biology, Institute for Theoretical Biology
  https://www.livermetabolism.com
koni...@googlemail.com

Nicolas Rodriguez

unread,
Dec 18, 2017, 5:48:05 AM12/18/17
to jsbml-de...@googlegroups.com



On 18/12/17 10:43, 'Matthias König' via jsbml-development wrote:
Hi Nico,
I am following the changes in the github repository and saw the release on github. I thought this was already the official release.

Thanks for the fix. Unfortunately, I can't test it yet.
Could you update the version in the repository to 1.4-SNAPSHOT?

If you use 1.3-SNAPSHOT, it should be fine and your project should get the fix.

To unsubscribe from this group and stop receiving emails from it, send an email to jsbml-developm...@googlegroups.com.
To post to this group, send email to jsbml-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsbml-development/CAEUx3EQ7W3%2B8a91Cfouj%2BHeZ5TFFg4p%3D_%2BYvWQWSb7H92s12JA%40mail.gmail.com.

Matthias König

unread,
Dec 18, 2017, 2:41:22 PM12/18/17
to jsbml-development
Thanks a lot. Issue is fixed.

Best Matthias

--
You received this message because you are subscribed to a topic in the Google Groups "jsbml-development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsbml-development/AlzHCwHdoCA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsbml-development+unsubscribe@googlegroups.com.
To post to this group, send email to jsbml-development@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages