Problems reading in SIRI data

62 views
Skip to first unread message

mirkog

unread,
Sep 8, 2022, 11:35:31 AM9/8/22
to OpenTripPlanner Users
Hi,
I am trying to read in SIRI data for Norway as described here: http://docs.opentripplanner.org/en/latest/Netex-Norway/

I use `otp-2.1.0-shaded.jar` and have built the graph.obj from the `norway-latest.osm.pbf` file.
Now I am trying to access SIRI data from https://api.entur.io/realtime/v1/rest/et and  https://api.entur.io/realtime/v1/rest/sx (listed by Entur here: https://developer.entur.org/pages-real-time-api). For that I created the following `router-config.json` file:

```
{
    "updaters": [
        {
            "type": "siri-sx-updater",
            "frequencySec": 60,
            "url": "https://api.entur.io/realtime/v1/rest/",
            "feedId": "sx",
            "blockReadinessUntilInitialized": true
        },
        {
            "type": "siri-et-updater",
            "frequencySec": 20,
            "previewIntervalMinutes": 180,
            "url": "https://api.entur.io/realtime/v1/rest/",
            "feedId": "et",
            "blockReadinessUntilInitialized": true
        }
    ]
}
```
When running `java -Xmx6G -jar otp-2.1.0-shaded.jar --load otp_config_folder` I get the following errors:

```
17:01:12.422 INFO (SiriETHttpTripUpdateSource.java:92) Updating ET [otp-f914be19-3686-451a-8f33-42279a744b5e]: Create req: 2, Fetching data: 0, Unmarshalling: 0
17:01:12.746 INFO (SiriSXUpdater.java:176) Failed after 1 ms
17:01:12.746 ERROR (SiriSXUpdater.java:177) Error reading SIRI feed from https://api.entur.io/realtime/v1/rest/
javax.xml.stream.XMLStreamException: java.net.MalformedURLException
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:240)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:210)
    at java.xml/com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:262)
    at java.xml/com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:129)
    at org.rutebanken.siri20.util.SiriXml.parseXml(SiriXml.java:51)
    at org.opentripplanner.ext.siri.updater.SiriHelper.unmarshal(SiriHelper.java:38)
    at org.opentripplanner.ext.siri.updater.SiriSXUpdater.getUpdates(SiriSXUpdater.java:152)
    at org.opentripplanner.ext.siri.updater.SiriSXUpdater.runPolling(SiriSXUpdater.java:102)
    at org.opentripplanner.updater.PollingGraphUpdater.run(PollingGraphUpdater.java:58)
    at org.opentripplanner.updater.GraphUpdaterManager.lambda$startUpdaters$0(GraphUpdaterManager.java:88)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.MalformedURLException: null
    at java.base/java.net.URL.<init>(URL.java:679)
    at java.base/java.net.URL.<init>(URL.java:541)
    at java.base/java.net.URL.<init>(URL.java:488)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:649)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1396)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:1347)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:256)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:225)
    ... 12 common frames omitted
Caused by: java.lang.NullPointerException: null
    at java.base/java.net.URL.<init>(URL.java:585)
    ... 19 common frames omitted
17:01:12.748 INFO (SiriSXUpdater.java:179) Updating SX [otp-f3ce172a-830b-4880-9b38-bd3b4134e6dc]: Create req: 1, Fetching data: 77, Unmarshalling: 0
17:01:32.461 INFO (SiriETHttpTripUpdateSource.java:89) Failed after 38 ms
17:01:32.461 WARN (SiriETHttpTripUpdateSource.java:90) Failed to parse SIRI-ET feed from https://api.entur.io/realtime/v1/rest/:
java.lang.IllegalArgumentException: timeout can't be negative
    at java.base/java.net.Socket.setSoTimeout(Socket.java:1157)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:120)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at org.opentripplanner.ext.siri.SiriHttpUtils.postData(SiriHttpUtils.java:34)
    at org.opentripplanner.ext.siri.updater.SiriETHttpTripUpdateSource.getUpdates(SiriETHttpTripUpdateSource.java:65)
    at org.opentripplanner.ext.siri.updater.SiriETUpdater.runPolling(SiriETUpdater.java:125)
    at org.opentripplanner.updater.PollingGraphUpdater.run(PollingGraphUpdater.java:58)
    at org.opentripplanner.updater.GraphUpdaterManager.lambda$startUpdaters$0(GraphUpdaterManager.java:88)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
```

What am I doing wrong? I have also tried to add the `sx` and `et` parameters to the URL (since I am not entirely sure what the `feederId` is), but with the same result.

Thanks and kind regards
Mirko
Reply all
Reply to author
Forward
0 new messages