Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8972 closed defect (fixed)

Receiving nullpointer exception when loading map style whose paths are relative to zip root

Reported by: skorasaurus Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: mapcss Cc:

Description

When I load this zip as a map styling - https://github.com/hotosm/HDM-JOSM-style/archive/master.zip , I receive the following error. This feature was originally implemented in https://josm.openstreetmap.de/ticket/8686

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-08-15 01:35:02
Last Changed Author: bastiK
Revision: 6150
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-08-14 16:23:33 +0200 (Wed, 14 Aug 2013)
Last Changed Rev: 6150

Identification: JOSM/1.5 (6150 en) Linux Ubuntu 12.04.2 LTS
Memory Usage: 234 MB / 1658 MB (144 MB allocated, but free)
Java version: 1.7.0_25, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u25-2.3.10-1ubuntu0.12.04.2
Dataset consistency test: No problems found

Plugin: ImageWayPoint (29799)
Plugin: OpeningHoursEditor (29778)
Plugin: buildings_tools (29778)
Plugin: colorscheme (29435)
Plugin: dataimport (29435)
Plugin: download_along (29778)
Plugin: geochat (29592)
Plugin: gpxfilter (29778)
Plugin: imagery_offset_db (29467)
Plugin: imageryadjust (29609)
Plugin: lakewalker (29771)
Plugin: measurement (29750)
Plugin: mirrored_download (29753)
Plugin: notes (0.3)
Plugin: openstreetbugs (29435)
Plugin: openvisible (29778)
Plugin: pbf (29708)
Plugin: photo_geotagging (29435)
Plugin: poly (29711)
Plugin: reltoolbox (29535)
Plugin: reverter (29771)
Plugin: utilsplugin2 (29771)
Plugin: waydownloader (29771)
Plugin: waypoint_search (29435)
Plugin: wayselector (29771)

java.lang.NullPointerException
	at org.openstreetmap.josm.gui.preferences.SourceEntry.getZipEntryDirName(SourceEntry.java:166)
	at org.openstreetmap.josm.gui.mappaint.MapPaintStyles.getIcon(MapPaintStyles.java:94)
	at org.openstreetmap.josm.gui.mappaint.StyleSource.getSourceIcon(StyleSource.java:77)
	at org.openstreetmap.josm.gui.mappaint.StyleSource.getIcon(StyleSource.java:88)
	at org.openstreetmap.josm.gui.dialogs.MapPaintDialog$StyleSourceRenderer.getTableCellRendererComponent(MapPaintDialog.java:337)
	at javax.swing.JTable.prepareRenderer(JTable.java:5731)
	at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2108)
	at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2010)
	at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1806)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
	at javax.swing.JComponent.paintComponent(JComponent.java:769)
	at javax.swing.JComponent.paint(JComponent.java:1045)
	at javax.swing.JComponent.paintChildren(JComponent.java:878)
	at javax.swing.JComponent.paint(JComponent.java:1054)
	at javax.swing.JComponent.paintChildren(JComponent.java:878)
	at javax.swing.JComponent.paint(JComponent.java:1054)
	at javax.swing.JViewport.paint(JViewport.java:731)
	at javax.swing.JComponent.paintChildren(JComponent.java:878)
	at javax.swing.JComponent.paint(JComponent.java:1054)
	at javax.swing.JComponent.paintChildren(JComponent.java:878)
	at javax.swing.JComponent.paint(JComponent.java:1054)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5212)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:295)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1236)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5160)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4971)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:784)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
	at javax.swing.RepaintManager.access$1000(RepaintManager.java:62)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1647)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at java.awt.Component.show(Component.java:1651)
	at java.awt.Component.setVisible(Component.java:1603)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.openstreetmap.josm.gui.ExtendedDialog.setVisible(ExtendedDialog.java:476)
	at org.openstreetmap.josm.gui.ExtendedDialog.showDialog(ExtendedDialog.java:269)
	at org.openstreetmap.josm.tools.BugReportExceptionHandler$1.run(BugReportExceptionHandler.java:108)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at java.awt.Component.show(Component.java:1651)
	at java.awt.Component.setVisible(Component.java:1603)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.openstreetmap.josm.gui.ExtendedDialog.setVisible(ExtendedDialog.java:476)
	at org.openstreetmap.josm.gui.ExtendedDialog.showDialog(ExtendedDialog.java:269)
	at org.openstreetmap.josm.tools.BugReportExceptionHandler$1.run(BugReportExceptionHandler.java:108)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Attachments (1)

test2.zip (1.9 KB ) - added by AlfonZ 11 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by bastiK, 11 years ago

I don't get an error, could you please attach an .osm file or note the download area?

by AlfonZ, 11 years ago

Attachment: test2.zip added

comment:2 by AlfonZ, 11 years ago

Try with test2.zip:
Open JOSM, add it into styles, New layer, NPE shows.

Also, it seems that

File dir = new File(inArchiveDir);
entry_name = new File(dir, full_name).getPath();

in ImageProvider.getIfAvailableZip doesn't work on Windows. It returns path with backslashes that subsequent zipFile.getEntry(entry_name) doesn't like and returns null.

comment:3 by bastiK, 11 years ago

In 6152/josm:

see #8972 - fix path separator

comment:4 by bastiK, 11 years ago

In [6151/josm]:

#8972 - Receiving nullpointer exception when loading map style whose paths are relative to zip root

comment:5 by bastiK, 11 years ago

AlfonZ, thanks for the analysis and the test file, could you please try again under Windows?

comment:6 by AlfonZ, 11 years ago

Component: unspecifiedCore
Resolution: fixed
Status: newclosed

It works now.

comment:7 by AlfonZ, 11 years ago

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

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.