Opened 16 years ago
Closed 15 years ago
#2359 closed defect (fixed)
Saving a gpx -> java.lang.ClassCastException in GpxWriter.writeAttr
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | gpx | Cc: |
Description
- Open a gpx file
- Rigthclick layer, "save as". Choose whatever name.
- Error:
Path: trunk
URL: http://josm.openstreetmap.de/svn/trunk
Repository Root: http://josm.openstreetmap.de/svn
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Revision: 1513
Node Kind: directory
Last Changed Author: stoecker
Last Changed Rev: 1513
Last Changed Date: 2009-03-24 16:58:16 +0100 (Tue, 24 Mar 2009)
Java version: 1.6.0_10
Plugins: AgPifoJ;utilsplugin
Plugin AgPifoJ Version: 14018
Plugin utilsplugin Version: 14121
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.String
at org.openstreetmap.josm.io.GpxWriter.writeAttr(GpxWriter.java:68)
at org.openstreetmap.josm.io.GpxWriter.wayPoint(GpxWriter.java:202)
at org.openstreetmap.josm.io.GpxWriter.writeTracks(GpxWriter.java:120)
at org.openstreetmap.josm.io.GpxWriter.write(GpxWriter.java:52)
at org.openstreetmap.josm.actions.SaveActionBase.save(SaveActionBase.java:199)
at org.openstreetmap.josm.actions.SaveActionBase.save(SaveActionBase.java:141)
at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:56)
at org.openstreetmap.josm.actions.SaveActionBase.actionPerformed(SaveActionBase.java:37)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.menuDragMouseReleased(BasicMenuItemUI.java:1329)
at javax.swing.JMenuItem.fireMenuDragMouseReleased(JMenuItem.java:568)
at javax.swing.JMenuItem.processMenuDragMouseEvent(JMenuItem.java:465)
at javax.swing.JMenuItem.processMouseEvent(JMenuItem.java:411)
at javax.swing.MenuSelectionManager.processMouseEvent(MenuSelectionManager.java:306)
at javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.eventDispatched(BasicPopupMenuUI.java:817)
at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2353)
at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2245)
at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2203)
at java.awt.Component.dispatchEventImpl(Component.java:4399)
at java.awt.Container.dispatchEventImpl(Container.java:2081)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
at java.awt.Container.dispatchEventImpl(Container.java:2067)
at java.awt.Window.dispatchEventImpl(Window.java:2458)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
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 (1)
Change History (16)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
I can still reproduce in 1514. I'm using Ubuntu.
Just attached a file that fails.
I suspect something with the timestamp, but I don't know.
comment:3 by , 16 years ago
If I use the editgpx plugin, I can convert a gpx-layer to a editgpx-layer. Then convert it back gpx-layer with anonymous timestamps, then I can save the gpx-layer fine.
comment:4 by , 16 years ago
Now I just tried to convert it to a editgpx layer, and back to gpx. Now the error is:
Path: trunk
URL: http://josm.openstreetmap.de/svn/trunk
Repository Root: http://josm.openstreetmap.de/svn
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Revision: 1515
Node Kind: directory
Last Changed Author: ulfl
Last Changed Rev: 1515
Last Changed Date: 2009-03-27 10:07:29 +0100 (Fri, 27 Mar 2009)
Java version: 1.6.0_10
Plugins: AgPifoJ;editgpx;utilsplugin
Plugin AgPifoJ Version: 14018
Plugin editgpx Version: 14247
Plugin utilsplugin Version: 14121
java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.String
at org.openstreetmap.josm.io.GpxWriter.writeAttr(GpxWriter.java:68)
at org.openstreetmap.josm.io.GpxWriter.wayPoint(GpxWriter.java:202)
at org.openstreetmap.josm.io.GpxWriter.writeTracks(GpxWriter.java:120)
at org.openstreetmap.josm.io.GpxWriter.write(GpxWriter.java:52)
at org.openstreetmap.josm.actions.SaveActionBase.save(SaveActionBase.java:199)
at org.openstreetmap.josm.actions.SaveActionBase.save(SaveActionBase.java:141)
at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:56)
at org.openstreetmap.josm.actions.SaveActionBase.actionPerformed(SaveActionBase.java:37)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.menuDragMouseReleased(BasicMenuItemUI.java:1329)
at javax.swing.JMenuItem.fireMenuDragMouseReleased(JMenuItem.java:568)
at javax.swing.JMenuItem.processMenuDragMouseEvent(JMenuItem.java:465)
at javax.swing.JMenuItem.processMouseEvent(JMenuItem.java:411)
at javax.swing.MenuSelectionManager.processMouseEvent(MenuSelectionManager.java:306)
at javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.eventDispatched(BasicPopupMenuUI.java:817)
at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2353)
at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2245)
at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2203)
at java.awt.Component.dispatchEventImpl(Component.java:4399)
at java.awt.Container.dispatchEventImpl(Container.java:2081)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
at java.awt.Container.dispatchEventImpl(Container.java:2067)
at java.awt.Window.dispatchEventImpl(Window.java:2458)
at java.awt.Component.dispatchEvent(Component.java:4331)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
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:6 by , 16 years ago
Summary: | Saving a gpx -> java exception → Saving a gpx -> java.lang.ClassCastException in GpxWriter.writeAttr |
---|
I added #2402 and noticed it's a duplicate with this one. There's two more files to try with. I managed also to somehow empty the second gpx file on my disk, don't know if it was the josm's doing or did I do something else wrong.. =)
comment:7 by , 16 years ago
I also noticed that if I remove the gpx files from the editor, save will be successful. So in my case the problem is in saving the gpx file data also.
comment:8 by , 16 years ago
Also, if the map data is chosen and save button is presses, it saves it cleanly. Only if gpx data is chosen, it will try to save it and the result will be empty gpx file.
If clicked the save button instead of save as, it will actually overwite the original gpx file with an empty file'''
I can't reproduce this in [1514], but from the backtrace it looks like the GPX file itself is at fault.
Could you attach the GPX file you're having trouble with to this bug report please.