[OSM-dev] Osmosis error read-xml (NullPointerException)

JuergenL osm at albspotter.org
Wed May 27 11:16:57 BST 2009


Hi

I try to extract a polygon out of a osm file using osmosis and I get
an error reading the osm file. I use
http://albspotter.org/osm/test-osmosis.osm but also tried other
osm-files and different versions of osmosis.

This is the output from osmosis --read-xml file="test-osmosis.osm"
--write-xml file="out.osm"

26.05.2009 14:08:46 org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.31.1
26.05.2009 14:08:46 org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
26.05.2009 14:08:46 org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
26.05.2009 14:08:46 org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
26.05.2009 14:08:47
org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager
waitForCompletion
SCHWERWIEGEND: Thread for task 1-read-xml failed
java.lang.NullPointerException
       at org.openstreetmap.osmosis.core.xml.common.ElementWriter.escapeData(ElementWriter.java:112)
       at org.openstreetmap.osmosis.core.xml.common.ElementWriter.addAttribute(ElementWriter.java:197)
       at org.openstreetmap.osmosis.core.xml.v0_6.impl.RelationMemberWriter.processRelationMember(RelationMemberWriter.java:43)
       at org.openstreetmap.osmosis.core.xml.v0_6.impl.RelationWriter.process(RelationWriter.java:75)
       at org.openstreetmap.osmosis.core.xml.v0_6.impl.OsmWriter$SubElementWriter.process(OsmWriter.java:165)
       at org.openstreetmap.osmosis.core.container.v0_6.RelationContainer.process(RelationContainer.java:60)
       at org.openstreetmap.osmosis.core.xml.v0_6.impl.OsmWriter.process(OsmWriter.java:82)
       at org.openstreetmap.osmosis.core.xml.v0_6.XmlWriter.process(XmlWriter.java:45)
       at org.openstreetmap.osmosis.core.xml.v0_6.impl.RelationElementProcessor.end(RelationElementProcessor.java:108)
       at org.openstreetmap.osmosis.core.xml.v0_6.impl.OsmHandler.endElement(OsmHandler.java:108)
       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
       at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
       at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
       at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
       at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:108)
       at java.lang.Thread.run(Thread.java:619)
26.05.2009 14:08:47 org.openstreetmap.osmosis.core.Osmosis main
SCHWERWIEGEND: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more
tasks failed.
       at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
       at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:85)
       at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:30)

How can I fix this error?

Thanks in advance

Juergen




More information about the dev mailing list