Modify

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

  1. Open a gpx file
  2. Rigthclick layer, "save as". Choose whatever name.
  3. 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)

20090315_144555.log.gpx (143.8 KB ) - added by anonymous 16 years ago.
File that can not be 're-saved'

Download all attachments as: .zip

Change History (16)

comment:1 by avarab@…, 16 years ago

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.

by anonymous, 16 years ago

Attachment: 20090315_144555.log.gpx added

File that can not be 're-saved'

comment:2 by anonymous, 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 anonymous, 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 anonymous, 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:5 by TuurEfe, 16 years ago

Ticket #2402 has been marked as a duplicate of this ticket.

comment:6 by TuurEfe, 16 years ago

Summary: Saving a gpx -> java exceptionSaving 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 TuurEfe, 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 TuurEfe, 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'''

comment:9 by stoecker, 15 years ago

Ticket #2371 has been marked as a duplicate of this ticket.

comment:10 by stoecker, 15 years ago

Ticket #2621 has been marked as a duplicate of this ticket.

comment:11 by stoecker, 15 years ago

Ticket #2592 has been marked as a duplicate of this ticket.

comment:12 by stoecker, 15 years ago

Ticket #2541 has been marked as a duplicate of this ticket.

comment:13 by stoecker, 15 years ago

Ticket #2477 has been marked as a duplicate of this ticket.

comment:14 by stoecker, 15 years ago

Ticket #2634 has been marked as a duplicate of this ticket.

comment:15 by stoecker, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in [o15186].

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.