Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3443 closed defect (fixed)

Illegal value for attribute 'version' when loading OSM file

Reported by: markb@… Owned by: team
Priority: blocker Milestone:
Component: Core Version: latest
Keywords: Cc: teemu.koskinen@…

Description

Today, having updated my josm to 2084 from 2066, I tried to load an osm file that I had saved yesterday. It failed with:

org.openstreetmap.josm.io.IllegalDataException: Illegal value for attribute 'version' on OSM primitive with id -1. Got 0 (at line 3, column 143)

at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:580)
at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:41)
at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:33)
at org.openstreetmap.josm.actions.OpenFileAction.openFile(OpenFileAction.java:57)
at org.openstreetmap.josm.Main.downloadFromParamString(Main.java:537)
at org.openstreetmap.josm.Main.postConstructorProcessCmdLine(Main.java:388)
at org.openstreetmap.josm.gui.MainApplication$2.run(MainApplication.java:163)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Attachments (2)

api05.patch (971 bytes) - added by vsandre 9 years ago.
setOsmId() accepts version=0
20080925.7z (45.6 KB) - added by anonymous 8 years ago.
api 0.5 file

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by Gubaer

Resolution: fixed
Status: newclosed

(In [2086]) fixed #3443: Illegal value for attribute 'version' when loading OSM file

comment:2 Changed 9 years ago by markb@…

Resolution: fixed
Status: closedreopened

Hmm, not fixed here as you can see - BTW this is a 0.5 API file and all the elements appear
to have version 0 - don't know when that version info was put into file.

Revision: Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 14.0-b16 (Sun Microsystems Inc.)
Main-class: JOSM
Main-Version: 2088 SVN
Main-Date: 2009-09-09T17:38:48.279227Z
loading colorscheme
loading graphview
loading measurement
loading utilsplugin
loading wmsplugin
org.openstreetmap.josm.io.IllegalDataException: Illegal value for attribute 'version' on OSM primitive with id 84532064. Got 0 (at line 7, column 138)

at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:583)
at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:41)
at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:33)
at org.openstreetmap.josm.actions.OpenFileAction.openFile(OpenFileAction.java:57)
at org.openstreetmap.josm.Main.downloadFromParamString(Main.java:537)
at org.openstreetmap.josm.Main.postConstructorProcessCmdLine(Main.java:388)
at org.openstreetmap.josm.gui.MainApplication$2.run(MainApplication.java:162)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

comment:3 Changed 9 years ago by Gubaer

(In [2089]) see #3443: Illegal value for attribute 'version' when loading OSM file

comment:4 Changed 9 years ago by Gubaer

Resolution: fixed
Status: reopenedclosed

Reading 0.5 files with primitive versions set to 0 (event for primitives with id >0 which now always have a version >=1) supported again. Version 0 will not be preserved. On the next save the primitive will have version 1.

comment:5 Changed 9 years ago by vsandre

Resolution: fixed
Status: closedreopened
Summary: Illegal value for attribute 'version' when loading OSM file[Patch] Illegal value for attribute 'version' when loading OSM file

Don't work for me with 2300. Please check the added patch.

Changed 9 years ago by vsandre

Attachment: api05.patch added

setOsmId() accepts version=0

comment:6 Changed 8 years ago by Gubaer

We shouldn't apply this patch. We don't allow version 0 on OsmPrimitives with an id > 0.

Could you please post an example file? I'll try to provide a fix in the IO subsystem, not in the core data package.

Changed 8 years ago by anonymous

Attachment: 20080925.7z added

api 0.5 file

comment:7 Changed 8 years ago by Gubaer

Resolution: fixed
Status: reopenedclosed

(In [2377]) fixed #3443: Illegal value for attribute 'version' when loading OSM file

comment:8 Changed 8 years ago by Daeron

Cc: teemu.koskinen@… added
Resolution: fixed
Status: closedreopened
Summary: [Patch] Illegal value for attribute 'version' when loading OSM fileIllegal value for attribute 'version' when loading OSM file

Josm doesn't save version for objects that are new, thus it is now impossible to open files which contain new objects.

comment:9 Changed 8 years ago by Gubaer

Resolution: fixed
Status: reopenedclosed

(In [2382]) fixed #3443: Illegal value for attribute 'version' when loading OSM file

comment:10 Changed 8 years ago by anonymous

Works great :-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.