CUTR-at-USF / ontime-performance-calculator

An application to calculate on-time performance using archived GTFS-realtime data
Other
4 stars 2 forks source link

Executing project without info.txt causes NullPointerException #14

Closed barbeau closed 7 years ago

barbeau commented 7 years ago

If you try to execute the project using directions in the README without creating the info.txt file that holds the database credentials, the application crashes with the following:

$ java -jar target/ontime-performance-calculator.jar target/hart.zip

Processing feed :hart.zip
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Agency
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.ShapePoint
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Route
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Stop
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Trip
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.StopTime
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.ServiceCalendar
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.ServiceCalendarDate
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.FareAttribute
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.FareRule
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Frequency
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Pathway
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.Transfer
[main] INFO org.onebusaway.gtfs.serialization.GtfsReader - reading entities: org.onebusaway.gtfs.model.FeedInfo

LoadStatus : SUCCESS
loadFailureReason : null
Exception in thread "main" java.lang.NullPointerException
        at java.io.Reader.<init>(Unknown Source)
        at java.io.InputStreamReader.<init>(Unknown Source)
        at edu.usf.cutr.ontimeperformance.DatabaseConnectionInfo.setFields(DatabaseConnectionInfo.java:47)
        at edu.usf.cutr.ontimeperformance.DatabaseConnectionInfo.<init>(DatabaseConnectionInfo.java:23)
        at edu.usf.cutr.ontimeperformance.FeedProcessor.load(FeedProcessor.java:122)
        at edu.usf.cutr.ontimeperformance.OntimePerformanceMain.main(OntimePerformanceMain.java:28)

We should provide a friendly error message saying to create the file instead of crashing.