Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » Serious problems when reading models with JSBML
Show: Today's Posts  :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
AuthorTopic
Andreas Dräger


Posts: 273
Registered:
June 2006
Serious problems when reading models with JSBML 30 Nov '10 01:54 Go to next message

Dear all,

It seems that after the latest changes in the repository reading SBML
files does not work properly anymore.

First, what is not so important, the parser now writes these
(unnecessary) messages when reading Level 2 Version 4 models:

WARN (SBMLCoreParser.java:405) - No unitDefinition matches the
areaUnitsID of Model.
WARN (SBMLCoreParser.java:415) - No unitDefinition matches the
lengthUnitsID of Model.
WARN (SBMLCoreParser.java:419) - No unitDefinition matches the
substanceUnitsID of Model.
WARN (SBMLCoreParser.java:422) - No unitDefinition matches the
timeUnitsID of Model.
WARN (SBMLCoreParser.java:425) - No unitDefinition matches the
volumeUnitsID of Model.

In L2V4 the model doesn't have all these attributes, hence, it is not
necessary to write this.

It seems that the parser does not set the Level/Version attribute
correctly. When trying to call the method

setHasOnlySubstanceUnits

in Species, we receive an

Exception in thread "AWT-EventQueue-0" Property hasOnlySubstanceUnits is
not defined for Level -1 and Version -1
at org.sbml.jsbml.Species.setHasOnlySubstanceUnits(Species.java:747)


Furthermore, there is also the problem of log4j that it is impossible to
find the log file. Is there a way to switch logging completely off?

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ./log/jsbml.log (No such file or directory)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:207)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:645)
at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
at org.apache.log4j.Logger.getLogger(Logger.java:94)
at
org.sbml.jsbml.xml.stax.SBMLReader.readSBMLFromStream(SBMLReader.java:397)
at org.sbml.jsbml.xml.stax.SBMLReader.readSBML(SBMLReader.java:340)


Cheers
Andreas

--
Dipl.-Bioinform. Andreas Dräger
Eberhard Karls University Tübingen
Center for Bioinformatics (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-70436
Fax: +49-7071-29-5091
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
rodrigue


Posts: 307
Location:
Cambridge UK
Registered:
February 2005
Re: Serious problems when reading models with JSBML 30 Nov '10 02:04 Go to previous messageGo to next message

On 11/30/2010 09:54 AM, Andreas Draeger wrote:
> Dear all,
>
> It seems that after the latest changes in the repository reading SBML
> files does not work properly anymore.
>
> First, what is not so important, the parser now writes these
> (unnecessary) messages when reading Level 2 Version 4 models:
>
> WARN (SBMLCoreParser.java:405) - No unitDefinition matches the
> areaUnitsID of Model.
> WARN (SBMLCoreParser.java:415) - No unitDefinition matches the
> lengthUnitsID of Model.
> WARN (SBMLCoreParser.java:419) - No unitDefinition matches the
> substanceUnitsID of Model.
> WARN (SBMLCoreParser.java:422) - No unitDefinition matches the
> timeUnitsID of Model.
> WARN (SBMLCoreParser.java:425) - No unitDefinition matches the
> volumeUnitsID of Model.
This messages where always there but were not printed. I put them on, so
that we can perfect the parser.
Of course for L2, we should not have this warnings and we should not
have them either for L3 if the attribute are not defined in the model.

> In L2V4 the model doesn't have all these attributes, hence, it is not
> necessary to write this.
>
> It seems that the parser does not set the Level/Version attribute
> correctly. When trying to call the method
>
> setHasOnlySubstanceUnits
>
> in Species, we receive an
>
> Exception in thread "AWT-EventQueue-0" Property hasOnlySubstanceUnits is
> not defined for Level -1 and Version -1
> at org.sbml.jsbml.Species.setHasOnlySubstanceUnits(Species.java:747)
>
>
> Furthermore, there is also the problem of log4j that it is impossible to
> find the log file. Is there a way to switch logging completely off?
>
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: ./log/jsbml.log (No such file or directory)
I just answered about that, just do an update and it will works.

To configure log4j, you need to edit the file src/log4j.properties
At the moment, log4j is setup to print at the DEBUG level on the console
and on the jsbml.log file.

You have also lines like that :

log4j.logger.org.sbml.jsbml.util=WARN
log4j.logger.org.sbml.jsbml.xml.parsers.StringParser=WARN

Which prevent to display the DEBUG output of the classes in the
org.sbml.jsbml.util package and of the class
org.sbml.jsbml.xml.parsers.StringParser.
You need to comment these line, they will then inherit the glogal level,
so DEBUG or you can set something else than WARN.

Cheers,
Nico




____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: Serious problems when reading models with JSBML 30 Nov '10 02:20 Go to previous messageGo to next message

Hi all,

> On 11/30/2010 09:54 AM, Andreas Draeger wrote:
>> Dear all,
>>
>> It seems that after the latest changes in the repository reading SBML
>> files does not work properly anymore.
>>
>> First, what is not so important, the parser now writes these
>> (unnecessary) messages when reading Level 2 Version 4 models:
>>
>> WARN (SBMLCoreParser.java:405) - No unitDefinition matches the
>> areaUnitsID of Model.
>> WARN (SBMLCoreParser.java:415) - No unitDefinition matches the
>> lengthUnitsID of Model.
>> WARN (SBMLCoreParser.java:419) - No unitDefinition matches the
>> substanceUnitsID of Model.
>> WARN (SBMLCoreParser.java:422) - No unitDefinition matches the
>> timeUnitsID of Model.
>> WARN (SBMLCoreParser.java:425) - No unitDefinition matches the
>> volumeUnitsID of Model.
> This messages where always there but were not printed. I put them on, so
> that we can perfect the parser.
> Of course for L2, we should not have this warnings and we should not
> have them either for L3 if the attribute are not defined in the model.
>
>> In L2V4 the model doesn't have all these attributes, hence, it is not
>> necessary to write this.


It would be nice if we can avoid messages if not required.

>>
>> It seems that the parser does not set the Level/Version attribute
>> correctly. When trying to call the method
>>
>> setHasOnlySubstanceUnits
>>
>> in Species, we receive an
>>
>> Exception in thread "AWT-EventQueue-0" Property hasOnlySubstanceUnits is
>> not defined for Level -1 and Version -1
>> at org.sbml.jsbml.Species.setHasOnlySubstanceUnits(Species.java:747)
>>
>>
>> Furthermore, there is also the problem of log4j that it is impossible to
>> find the log file. Is there a way to switch logging completely off?
>>
>> log4j:ERROR setFile(null,true) call failed.
>> java.io.FileNotFoundException: ./log/jsbml.log (No such file or directory)
> I just answered about that, just do an update and it will works.


Sorry, but the same ERROR still occurs. My application crashes when
trying to set the hasOnlySubstanceUnits attribute because the L/V
combination is set to -1 and -1 although I parsed SBML test model case 1.

>
> To configure log4j, you need to edit the file src/log4j.properties
> At the moment, log4j is setup to print at the DEBUG level on the console
> and on the jsbml.log file.
>
> You have also lines like that :
>
> log4j.logger.org.sbml.jsbml.util=WARN
> log4j.logger.org.sbml.jsbml.xml.parsers.StringParser=WARN
>
> Which prevent to display the DEBUG output of the classes in the
> org.sbml.jsbml.util package and of the class
> org.sbml.jsbml.xml.parsers.StringParser.
> You need to comment these line, they will then inherit the glogal level,
> so DEBUG or you can set something else than WARN.

Would it be possible to switch messages off by default? I mean, people
will not like to do much configuration. The default value should be: no
messages, no logging.

Cheers
Andreas

--
Dipl.-Bioinform. Andreas Dräger
Eberhard Karls University Tübingen
Center for Bioinformatics (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-70436
Fax: +49-7071-29-5091
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
rodrigue


Posts: 307
Location:
Cambridge UK
Registered:
February 2005
Re: Serious problems when reading models with JSBML 30 Nov '10 02:28 Go to previous messageGo to next message

On 11/30/2010 10:20 AM, Andreas Draeger wrote:
> Hi all,
>
>> On 11/30/2010 09:54 AM, Andreas Draeger wrote:
>>> Dear all,
>>>
>>> It seems that after the latest changes in the repository reading SBML
>>> files does not work properly anymore.
>>>
>>> First, what is not so important, the parser now writes these
>>> (unnecessary) messages when reading Level 2 Version 4 models:
>>>
>>> WARN (SBMLCoreParser.java:405) - No unitDefinition matches the
>>> areaUnitsID of Model.
>>> WARN (SBMLCoreParser.java:415) - No unitDefinition matches the
>>> lengthUnitsID of Model.
>>> WARN (SBMLCoreParser.java:419) - No unitDefinition matches the
>>> substanceUnitsID of Model.
>>> WARN (SBMLCoreParser.java:422) - No unitDefinition matches the
>>> timeUnitsID of Model.
>>> WARN (SBMLCoreParser.java:425) - No unitDefinition matches the
>>> volumeUnitsID of Model.
>> This messages where always there but were not printed. I put them on, so
>> that we can perfect the parser.
>> Of course for L2, we should not have this warnings and we should not
>> have them either for L3 if the attribute are not defined in the model.
>>
>>> In L2V4 the model doesn't have all these attributes, hence, it is not
>>> necessary to write this.
>
> It would be nice if we can avoid messages if not required.
Yes, of course, it is on the todo list.
The messages are there because the code of the parser is wrong at the
moment.

>>> It seems that the parser does not set the Level/Version attribute
>>> correctly. When trying to call the method
>>>
>>> setHasOnlySubstanceUnits
>>>
>>> in Species, we receive an
>>>
>>> Exception in thread "AWT-EventQueue-0" Property hasOnlySubstanceUnits is
>>> not defined for Level -1 and Version -1
>>> at org.sbml.jsbml.Species.setHasOnlySubstanceUnits(Species.java:747)
>>>
>>>
>>> Furthermore, there is also the problem of log4j that it is impossible to
>>> find the log file. Is there a way to switch logging completely off?
>>>
>>> log4j:ERROR setFile(null,true) call failed.
>>> java.io.FileNotFoundException: ./log/jsbml.log (No such file or directory)
>> I just answered about that, just do an update and it will works.
>
> Sorry, but the same ERROR still occurs. My application crashes when
> trying to set the hasOnlySubstanceUnits attribute because the L/V
> combination is set to -1 and -1 although I parsed SBML test model case 1.
>

I was speaking about the log file problem here. I haven't had time to
look at the issue with setHasOnlySubstanceUnits.

>> To configure log4j, you need to edit the file src/log4j.properties
>> At the moment, log4j is setup to print at the DEBUG level on the console
>> and on the jsbml.log file.
>>
>> You have also lines like that :
>>
>> log4j.logger.org.sbml.jsbml.util=WARN
>> log4j.logger.org.sbml.jsbml.xml.parsers.StringParser=WARN
>>
>> Which prevent to display the DEBUG output of the classes in the
>> org.sbml.jsbml.util package and of the class
>> org.sbml.jsbml.xml.parsers.StringParser.
>> You need to comment these line, they will then inherit the glogal level,
>> so DEBUG or you can set something else than WARN.
> Would it be possible to switch messages off by default? I mean, people
> will not like to do much configuration. The default value should be: no
> messages, no logging.
>
Of course, but we are on the developing/debugging stage at the moment.
But we can modify the log4j.properties file if needed.

We would have to have a documentation to explain a bit how to do.

Nico




____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: Serious problems when reading models with JSBML 30 Nov '10 02:36 Go to previous messageGo to next message

>> Sorry, but the same ERROR still occurs. My application crashes when
>> trying to set the hasOnlySubstanceUnits attribute because the L/V
>> combination is set to -1 and -1 although I parsed SBML test model case 1.
>>
>
> I was speaking about the log file problem here. I haven't had time to
> look at the issue with setHasOnlySubstanceUnits.

Hi Nico,

Thanks for your quick answer. This was probably a misunderstanding: The
serious problem was not that the logger wrote some messages. It was the
crash of the application due to an incorrect LV configuration. Hence
there was confusion because I thought you already solved the more
important bug. Anyway, many thanks.

Cheers
Andreas

--
Dipl.-Bioinform. Andreas Dräger
Eberhard Karls University Tübingen
Center for Bioinformatics (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-70436
Fax: +49-7071-29-5091
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
rodrigue


Posts: 307
Location:
Cambridge UK
Registered:
February 2005
Re: Serious problems when reading models with JSBML 30 Nov '10 03:15 Go to previous messageGo to next message

On 11/30/2010 09:54 AM, Andreas Draeger wrote:
> In L2V4 the model doesn't have all these attributes, hence, it is not
> necessary to write this.
>
> It seems that the parser does not set the Level/Version attribute
> correctly. When trying to call the method
>
> setHasOnlySubstanceUnits
>
> in Species, we receive an
>
> Exception in thread "AWT-EventQueue-0" Property hasOnlySubstanceUnits is
> not defined for Level -1 and Version -1
> at org.sbml.jsbml.Species.setHasOnlySubstanceUnits(Species.java:747)
>
Can you explain how you get the error ?
It is after reading a file or did you create the Species by hand ?

I tried it on the SBML_L2V1Test.read3() (commited) and it seems to be
fine for me.

Thanks,
Nico

____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: Serious problems when reading models with JSBML 14 Dec '10 05:13 Go to previous message

>> In L2V4 the model doesn't have all these attributes, hence, it is not
>> necessary to write this.
>>
>> It seems that the parser does not set the Level/Version attribute
>> correctly. When trying to call the method
>>
>> setHasOnlySubstanceUnits
>>
>> in Species, we receive an
>>
>> Exception in thread "AWT-EventQueue-0" Property hasOnlySubstanceUnits is
>> not defined for Level -1 and Version -1
>> at org.sbml.jsbml.Species.setHasOnlySubstanceUnits(Species.java:747)
>>
> Can you explain how you get the error ?
> It is after reading a file or did you create the Species by hand ?
>
> I tried it on the SBML_L2V1Test.read3() (commited) and it seems to be
> fine for me.

Hi all,

this error was my mistake. In my own application I simply forgot to set
the level and version attribute for a species. Great that we throw
exceptions now when illegally trying to access properties, so it is much
easier to find incorrect code.

Cheers
Andreas

--
Dipl.-Bioinform. Andreas Dräger
Eberhard Karls University Tübingen
Center for Bioinformatics (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-70436
Fax: +49-7071-29-5091
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Problems when parsing an SBML document
Next Topic:JSBML interface
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.