Closed Eljah closed 7 years ago
So the source exception is
at de.westnordost.osmapi.map.MapDataParser.onEndElement(MapDataParser.java:164)
handler is null.
This should be the expection you get if you pass null for the handler in mapDataDao.getMap
thanks a lot; I supposed null be never got
Hi!
Please take a look at my programm and the exception:
import de.westnordost.osmapi.OsmConnection; import de.westnordost.osmapi.map.MapDataDao; import de.westnordost.osmapi.map.data.*; import de.westnordost.osmapi.map.handler.MapDataHandler;
/**
Created by eljah32 on 9/21/2017. */ public class ConnectionTester { public static void main(String[] args) { OsmConnection osm = new OsmConnection( "http://api.openstreetmap.org/api/0.6/", "BusRouteDataExtractor 1.0", null);
} }
Exception in thread "main" de.westnordost.osmapi.common.errors.OsmApiReadResponseException: de.westnordost.osmapi.common.errors.XmlParserException: Error parsing XML at END_TAG @3997:13 in java.io.InputStreamReader@4079d7b3 at de.westnordost.osmapi.OsmConnection.handleResponse(OsmConnection.java:322) А77 пер. Дуслык – Нефтебаза at de.westnordost.osmapi.OsmConnection.makeRequest(OsmConnection.java:191) at de.westnordost.osmapi.OsmConnection.makeRequest(OsmConnection.java:142) at de.westnordost.osmapi.map.MapDataDao.getMap(MapDataDao.java:194) at ConnectionTester.main(ConnectionTester.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Caused by: de.westnordost.osmapi.common.errors.XmlParserException: Error parsing XML at END_TAG @3997:13 in java.io.InputStreamReader@4079d7b3 at de.westnordost.osmapi.common.XmlParser.doParse(XmlParser.java:64) at de.westnordost.osmapi.map.MapDataParser.parse(MapDataParser.java:58) at de.westnordost.osmapi.map.MapDataParser.parse(MapDataParser.java:20) at de.westnordost.osmapi.OsmConnection.handleResponse(OsmConnection.java:314) ... 9 more Caused by: java.lang.NullPointerException at ConnectionTester$1.handle(ConnectionTester.java:38) at de.westnordost.osmapi.map.MapDataParser.onEndElement(MapDataParser.java:164) at de.westnordost.osmapi.common.XmlParser.doParse(XmlParser.java:49) ... 12 more