Skip to content

faq 162758670

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

Error in pt-simple example

by Marianne Petersen on 2018-01-31 09:27:58


Hello,

I am trying to run some basic examples with MATSim.
The version I am using is 0.9.0 and the java version 9.0.4.
Running the pt-simple example I get warnings and errors.

Warnings:
- They seem only to refere to Java problems. Do they affect the result of the simulation?
Errors:
- There are two MATSim errors. What do they mean?
- How bad does the last error effect the simulation? After searching the internet I found out that it seems to be an issue using java 9.0.4.

Thank you for your help!


Comments: 3


Re: Error in pt-simple example

by Thibaut Dubernet on 2018-01-31 09:54:03

Dear Marianne,

thank you for the detailed report of the problem, as it really helps pinpoint the problem!

I had similar issues recently when playing around with Java 9. The problem is the new modular structure of the JDK/JVM, where some "enterprise" features (including XML parsing) are still there but disabled by default. It seems some of those features are used by MATSim, and thus fail to run when using a JDK/JVM version 9. If you can, the easiest solution would be to run MATSim using a JVM version 8. If you can not or do not want to do so, this StackOverflow answer discusses solutions to this problem in more detail:

https://stackoverflow.com/a/43574427/7161277

I did not attempt any of those solutions, as in my case just using JDK version 8 was a valid "solution".


Re: Error in pt-simple example

by Kai Nagel on 2018-01-31 10:05:30

If I look into logfileWarningsErrors.log, there are two things:

  1. last activity ... has endTime < infinity. This will probably not cause problems; still, the recommendation is to just not put any endTime at all into the last activity. The reason is that we "wrap around" activities (i.e. merge them with the first activity of the day), and if you specify an end time, it is in fact not really clear what you want to say.

  2. The failure to write the lanes is not good. Many files were written before this error is encountered, but you don't have output_events. You could use the events of the last iteration instead, but still ... . I seem to recall that this is due to java9 no longer having Jaxb by default. So it would need to be added by maven. Since matsim officially is still at java8, we haven't looked into this yet. Maybe someone else can come to the rescue. Until then: Downgrade to java8. This may, the way it looks, also (or maybe in particular) mean to downgrade the runtime environment. Or you could try to add the jaxb dependency yourself to your pom.xml. If you have added maven dependencies before, then this should be easy. Otherwise maybe not, in particular since this is a runtime dependency. But clearly, the official answer is: downgrade to java8.


Re: Error in pt-simple example

by Marianne Petersen on 2018-01-31 13:31:58

Dear Thibaut and Kai,

Thank you very much for your fast answer!
I downgraded to Java8. The result was that I did not get any error concerning java :-)
Deleting the end time of the last activity of each agent erased as well the MATSim error.
Thus the example runs fine now.

Clone this wiki locally