Modify

Opened 3 years ago

Closed 3 years ago

#21682 closed defect (fixed)

[Patch] Exceptions in layer change listeners prevent JOSM from closing

Reported by: Woazboat Owned by: team
Priority: normal Milestone: 21.12
Component: Core Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Press the X button to close the window
  2. Nothing happens, JOSM doesn't close

What is the expected result?

JOSM should close when pressing the "close window" button

What happens instead?

JOSM doesn't close, an error message about the wikidata API not being available is printed to the console.

Please provide any additional information below. Attach a screenshot if possible.

Revision:18327
Is-Local-Build:true
Build-Date:2021-12-18 17:09:05

Identification: JOSM/1.5 (18327 SVN en_GB) Linux Debian GNU/Linux bookworm/sid
Memory Usage: 409 MB / 3982 MB (150 MB allocated, but free)
Java version: 12.0.2+9-Debian-1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920×1080 (scaling 1.00×1.00) :0.1 1920×1080 (scaling 1.00×1.00) :0.2 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_AT.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_GB
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: KDE
Java ATK Wrapper package: libatk-wrapper-java:all-0.38.0-5
libcommons-compress-java: libcommons-compress-java:all-1.21-1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:all-20201225-1
liboauth-signpost-java: liboauth-signpost-java:all-1.2.1.2-3

Plugins:
+ CADTools (1008)
+ DirectDownload (35640)
+ EasyPresets (1623509627)
+ FastDraw (35864)
+ Lanes (${version.entry.commit.revision})
+ Mapillary (2.0.0-alpha.48)
+ OpeningHoursEditor (35640)
+ PicLayer (1.0.1)
+ alignways (35753)
+ apache-commons (35524)
+ apache-http (35589)
+ areaselector (368)
+ austriaaddresshelper (1597341117)
+ buildings_tools (35823)
+ centernode (v1.0.4)
+ changeset-viewer (25)
+ conflation (0.6.8)
+ contourmerge (v0.1.8)
+ editgpx (35562)
+ ejml (35458)
+ flatlaf (35862)
+ geotools (35458)
+ gridify (1606242219)
+ gson (35458)
+ imagery_offset_db (35640)
+ indoorhelper (1.2.0)
+ intersection (0.0.7)
+ jackan (${version.entry.commit.revision})
+ jaxb (35543)
+ jna (35662)
+ jogl (1.2.3)
+ jts (35458)
+ kartverketimport (35)
+ kendzi3d (1.0.205)
+ kendzi3d-resources (0.0.2)
+ log4j (35852)
+ measurement (35640)
+ opendata (35803)
+ openqa (0.2.2)
+ osmwiki-dataitem (1.2.3)
+ pt_assistant (1ff2e15)
+ reltoolbox (35829)
+ reverter (35846)
+ rex (53)
+ shrinkwrap (v1.0.4)
+ splinex (35866)
+ tageditor (35640)
+ terracer (35827)
+ todo (30306)
+ turnlanes-tagging (288)
+ turnrestrictions (35640)
+ utilsplugin2 (35856)
+ wikipedia (1.1.4)

Tagging presets:
+ https://github.com/kendzi/Simple3dBuildingsPreset/releases/download/0.9_2018-05-08/s3db-preset.zip
+ https://josm.openstreetmap.de/josmfile?page=Presets/BicycleJunction&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Historic_Stone&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Bus_lanes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Healthcare&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Heritage&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Historical_Objects&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Industrial&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Leaftype&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Light_sources&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Manholes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/MastAndTower&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/public_bookcase&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Simple_Indoor_Tagging&zip=1
+ https://raw.githubusercontent.com/species/josm-preset-wheelchair/master/sidewalks_kerbs.xml
+ https://osmtools.de/josm/steps.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/StreetCabinet&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Surveillance&zip=1
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/A.zip
+ https://josm.openstreetmap.de/josmfile?page=Presets/Trees&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/COVID-19&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/ParkingLanes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/PublicTransportOneClick&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/TurnLanes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/contact(socialnetworks_IMs)&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Playground_Equipment&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/PublicTransportGtfs&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Windrad&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/AdvertisingPreset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Community_Centre&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Crafts&zip=1
+ https://gitlab.com/k127/josm-presets/raw/master/diplomatic.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Mountains&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Disc_Golf_Course&zip=1
+ ${HOME}/josm/josm_area_highway_preset.xml
+ <josm.userdata>/EasyPresets.xml
+ ${HOME}/syncthing/Sync/Projects/OSM/josm/core/resources/data/defaultpresets.xml

Map paint styles:
+ ${HOME}/syncthing/Sync/Projects/OSM/josm_git/resources/styles/standard/elemstyles.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ https://raw.githubusercontent.com/yopaseopor/indoormap/master/indoormap-style.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/Bench&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
+ https://raw.githubusercontent.com/species/josm-preset-traffic_sign_direction/master/direction.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
+ https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/plan.at&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransportV2&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/sac_scale&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/BesideTheRoad_Speed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/AdvertisingStyle&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Admin_Boundaries&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Building_Levels_Labels&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Kerbs&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Postcode&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Suburb&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/DestinationSignRelation&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Direction&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/FixmeAndNote&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Landcover&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Mountains&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/NoFeature&zip=1
- https://raw.githubusercontent.com/OpenSidewalks/OpenSidewalks-Schema/master/open_sidewalks.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/PTStops&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/RecyclingMaterials&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleBuildingTags&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SimpleRoofTags&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Noname&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Surface&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Ph_Typhoon&zip=1
- https://github.com/igitov/forest-josm-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Incline&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Power&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PriorityRoad&zip=1
- ${HOME}/josm/josm_area_highway_style.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/SidewalksAndFootways&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Direction&zip=1
- <josm.userdata>/styles/sit.mapcss

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/OSMLint&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/IndoorRules&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/QAToolInspiredValidations&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/KeepRight&zip=1
- https://josm.openstreetmap.de/josmfile?page=Rules/PublicTransportGtfs&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/Pictures&zip=1
+ ${HOME}/josm/josm_area_highway_validator.validator.mapcss
+ ${HOME}/josm/heritage_bda.validator.mapcss

Last errors/warnings:
2021-12-19 05:24:26.243 INFO: Changeset updater inactive
2021-12-19 05:24:26.243 INFO: Message notifier inactive
2021-12-19 05:24:26.243 INFO: RemoteControl::Server /127.0.0.1:8111 stopped.
2021-12-19 05:24:26.244 INFO: RemoteControl::Server /0:0:0:0:0:0:0:1:8111 stopped.
2021-12-19 05:24:26.710 INFO: POST https://www.wikidata.org/w/api.php (52 B) ...
^[[A2021-12-19 05:24:39.548 WARNING: When reading the JSON response from the Wikidata Action API, an error occured! (IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org)): java.io.IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org). Cause: java.net.UnknownHostException: www.wikidata.org
2021-12-19 05:24:39.549 WARNING: Could not initialize Wikipedia app for language 'en'!: java.io.IOException: When reading the JSON response from the Wikidata Action API, an error occured! (IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org)). Cause: java.io.IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org). Cause: java.net.UnknownHostException: www.wikidata.org
java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:221)
        at org.wikipedia.gui.WikipediaToggleDialog.updateWikipediaArticles(WikipediaToggleDialog.java:376)
        at org.wikipedia.gui.WikipediaToggleDialog.activeOrEditLayerChanged(WikipediaToggleDialog.java:405)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.fireActiveLayerChange(MainLayerManager.java:271)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.setActiveLayer(MainLayerManager.java:264)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.realRemoveSingleLayer(MainLayerManager.java:304)
        at org.openstreetmap.josm.gui.layer.LayerManager.realRemoveLayer(LayerManager.java:266)
        at org.openstreetmap.josm.gui.layer.LayerManager.lambda$removeLayer$1(LayerManager.java:248)
        at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:246)
        at org.openstreetmap.josm.gui.layer.LayerManager.removeLayer(LayerManager.java:248)
        at org.openstreetmap.josm.gui.layer.LayerManager.realResetState(LayerManager.java:515)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.realResetState(MainLayerManager.java:493)
        at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:246)
        at org.openstreetmap.josm.gui.layer.LayerManager.resetState(LayerManager.java:506)
        at org.openstreetmap.josm.gui.MainTermination.run(MainTermination.java:43)
        at org.openstreetmap.josm.spi.lifecycle.Lifecycle.exitJosm(Lifecycle.java:121)
        at org.openstreetmap.josm.gui.MainApplication.exitJosm(MainApplication.java:521)
        at org.openstreetmap.josm.gui.MainFrame$ExitWindowAdapter.windowClosing(MainFrame.java:199)
        at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
        at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
        at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
        at java.desktop/java.awt.Window.processWindowEvent(Window.java:2068)
        at java.desktop/javax.swing.JFrame.processWindowEvent(JFrame.java:298)
        at java.desktop/java.awt.Window.processEvent(Window.java:2027)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2762)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2021-12-19 05:24:39.587 INFO: POST https://www.wikidata.org/w/api.php (52 B) ...
2021-12-19 05:24:39.588 WARNING: When reading the JSON response from the Wikidata Action API, an error occured! (IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org)): java.io.IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org). Cause: java.net.UnknownHostException: www.wikidata.org
2021-12-19 05:24:39.588 WARNING: Could not initialize Wikipedia app for language 'en'!: java.io.IOException: When reading the JSON response from the Wikidata Action API, an error occured! (IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org)). Cause: java.io.IOException: Could not connect to the Wikidata Action API, probably a network issue or the website is currently offline (UnknownHostException: www.wikidata.org). Cause: java.net.UnknownHostException: www.wikidata.org
java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:221)
        at org.wikipedia.gui.WikipediaToggleDialog.processDatasetEvent(WikipediaToggleDialog.java:420)
        at org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter.dataChanged(DataSetListenerAdapter.java:36)
        at org.openstreetmap.josm.data.osm.event.DataChangedEvent.fire(DataChangedEvent.java:38)
        at org.openstreetmap.josm.data.osm.event.DatasetEventManager.fireConsolidatedEvents(DatasetEventManager.java:210)
        at org.openstreetmap.josm.data.osm.event.DatasetEventManager.access$300(DatasetEventManager.java:30)
        at org.openstreetmap.josm.data.osm.event.DatasetEventManager$EdtRunnable.run(DatasetEventManager.java:90)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

// After pressing the close button again:

2021-12-19 05:25:13.004 INFO: POST https://www.wikidata.org/w/api.php (52 B) ...
2021-12-19 05:25:13.725 INFO: POST https://www.wikidata.org/w/api.php (action=sitematrix format=json formatversion=2 utf8=1) -> HTTP/1.1 200 (339 ms)
2021-12-19 05:25:13.935 INFO: Successfully updated API cache for https://www.wikidata.org/w/api.php?action=sitematrix&format=json&formatversion=2&utf8=1
java.lang.IllegalArgumentException: Listener org.wikipedia.gui.WikidataInfoToggleDialog$$Lambda$1226/0x0000000800c40440@3694871c (instance of org.wikipedia.gui.WikidataInfoToggleDialog$$Lambda$1226/0x0000000800c40440) was not registered before or already removed.
        at org.openstreetmap.josm.tools.ListenerList.failRemove(ListenerList.java:137)
        at org.openstreetmap.josm.tools.ListenerList.removeListener(ListenerList.java:131)
        at org.openstreetmap.josm.data.osm.DataSet.removeSelectionListener(DataSet.java:591)
        at org.wikipedia.gui.WikidataInfoToggleDialog.lambda$new$3(WikidataInfoToggleDialog.java:101)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.fireActiveLayerChange(MainLayerManager.java:271)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.setActiveLayer(MainLayerManager.java:264)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.realRemoveSingleLayer(MainLayerManager.java:304)
        at org.openstreetmap.josm.gui.layer.LayerManager.realRemoveLayer(LayerManager.java:266)
        at org.openstreetmap.josm.gui.layer.LayerManager.lambda$removeLayer$1(LayerManager.java:248)
        at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:246)
        at org.openstreetmap.josm.gui.layer.LayerManager.removeLayer(LayerManager.java:248)
        at org.openstreetmap.josm.gui.layer.LayerManager.realResetState(LayerManager.java:515)
        at org.openstreetmap.josm.gui.layer.MainLayerManager.realResetState(MainLayerManager.java:493)
        at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:246)
        at org.openstreetmap.josm.gui.layer.LayerManager.resetState(LayerManager.java:506)
        at org.openstreetmap.josm.gui.MainTermination.run(MainTermination.java:43)
        at org.openstreetmap.josm.spi.lifecycle.Lifecycle.exitJosm(Lifecycle.java:121)
        at org.openstreetmap.josm.gui.MainApplication.exitJosm(MainApplication.java:521)
        at org.openstreetmap.josm.gui.MainFrame$ExitWindowAdapter.windowClosing(MainFrame.java:199)
        at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
        at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
        at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
        at java.desktop/java.awt.Window.processWindowEvent(Window.java:2068)
        at java.desktop/javax.swing.JFrame.processWindowEvent(JFrame.java:298)
        at java.desktop/java.awt.Window.processEvent(Window.java:2027)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2762)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Attachments (1)

josm_layerchange_listener_catch_v1.patch (886 bytes ) - added by Woazboat 3 years ago.

Download all attachments as: .zip

Change History (8)

in reply to:  description ; comment:1 by skyper, 3 years ago

Replying to Woazboat:

Revision:18327
Is-Local-Build:true
Build-Date:2021-12-18 17:09:05

Identification: JOSM/1.5 (18327 SVN en_GB) Linux Debian GNU/Linux bookworm/sid
Java version: 12.0.2+9-Debian-1, Debian, OpenJDK 64-Bit Server VM

Does this happen with josm-latest.jar from this site, too? You can also try our packages, see Download.
Anyway, please, use either openjdk-11 or openjdk-17, thanks.

comment:2 by skyper, 3 years ago

Owner: changed from floscher to Woazboat
Status: newneedinfo

Oh, a thread dump might be useful. Please, start josm from a terminal and use kill -QUITE [PID] in another terminal to get the tread dump printed to the first terminal.

in reply to:  1 comment:3 by Woazboat, 3 years ago

Replying to skyper:

Does this happen with josm-latest.jar from this site, too? You can also try our packages, see Download.
Anyway, please, use either openjdk-11 or openjdk-17, thanks.

The v18327 build I was using here didn't have any changes compared to upstream that would be relevant for this problem and it also happens in v18303 (josm tested/stable installed from debian repos). I haven't explicitly tested v18331, but there haven't really been any changes from v18327 to v18331 that would have any influence on this.

Anyway, I'm fairly certain I found the issue. Closing josm will cause layer change events to be fired for all currently open layers sequentially. The layer change event listener installed by the wikipedia plugin at https://github.com/JOSM/wikipedia/blob/master/src/main/java/org/wikipedia/gui/WikipediaToggleDialog.java#L405 doesn't handle connection failures properly and causes a null pointer exception which is propagated all the way up and interrupts the closing process. https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java#L267
If there is only one layer josm closes anyway, but if there are multiple open layers you need to press the close button multiple times (once for each layer) until it finally closes.

I guess the fix here is twofold:
1) The wikidata plugin should properly handle connection failures and not throw an exception in the layer change listener
2) Exceptions in individual layer change listeners should be caught in the core so that an error in one layer change listener doesn't interrupt the whole process

comment:4 by Woazboat, 3 years ago

Component: Plugin wikipediaCore
Summary: Unavailable wikidata API prevents JOSM from closing[Patch] Exceptions in layer change listeners prevent JOSM from closing

comment:5 by skyper, 3 years ago

Owner: changed from Woazboat to team
Status: needinfonew

comment:6 by Don-vip, 3 years ago

Milestone: 21.12

comment:7 by Don-vip, 3 years ago

Resolution: fixed
Status: newclosed

In 18337/josm:

fix #21682 - don't let runtime exceptions in layer change listeners prevent JOSM from closing (patch by Woazboat, modified)

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.