Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3443 closed defect (fixed)

Illegal value for attribute 'version' when loading OSM file

Reported by: markb@… Owned by: team
Priority: blocker 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 4 years ago.
setOsmId() accepts version=0
20080925.7z (45.6 KB) - added by anonymous 4 years ago.
api 0.5 file

Download all attachments as: .zip

Change History (12)

comment:1 Changed 4 years ago by Gubaer

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:2 Changed 4 years ago by markb@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 4 years ago by Gubaer

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

comment:4 Changed 4 years ago by Gubaer

  • Resolution set to fixed
  • Status changed from reopened to closed

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 4 years ago by vsandre

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from Illegal value for attribute 'version' when loading OSM file to [Patch] Illegal value for attribute 'version' when loading OSM file

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

Changed 4 years ago by vsandre

setOsmId() accepts version=0

comment:6 Changed 4 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 4 years ago by anonymous

api 0.5 file

comment:7 Changed 4 years ago by Gubaer

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:8 Changed 4 years ago by Daeron

  • Cc teemu.koskinen@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from [Patch] Illegal value for attribute 'version' when loading OSM file to Illegal 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 4 years ago by Gubaer

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:10 Changed 4 years ago by anonymous

Works great :-)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.