#19936 closed defect (fixed)
CommandLine plugin (circle, arc) frequently crashes JOSM
Reported by: | OceanVortex | Owned by: | Hind |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin commandline | Version: | latest |
Keywords: | template_report | Cc: | Don-vip |
Description
What steps will reproduce the problem?
- It won't *always* reproduce it, but using the CommandLine plugin and creating an arc or a circle will regularly crash JOSM. Very annoying, because I use these regularly.
What is the expected result?
Create an arc or circle.
What happens instead?
Crash, with the last warning being: java.lang.IllegalArgumentException: Listener org.openstreetmap.josm.actions.mapmode.DrawAction@25883e25 (instance of org.openstreetmap.josm.actions.mapmode.DrawAction) was not registered before or already removed.
At that point you can't even pick another tool or do much of anything except force JOSM to quit.
Please provide any additional information below. Attach a screenshot if possible.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-10-03 13:42:38 +0200 (Sat, 03 Oct 2020) Build-Date:2020-10-04 01:30:47 Revision:17084 Relative:URL: ^/trunk Identification: JOSM/1.5 (17084 en) Windows 7 64-Bit OS Build number: Windows 7 Professional (7601) Memory Usage: 726 MB / 3641 MB (303 MB allocated, but free) Java version: 1.8.0_261-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 2560x1440 (scaling 1.0x1.0) Maximum Screen Size: 2560x1440 Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32 VM arguments: [-Djosm.cache=<josm.cache>] Dataset consistency test: No problems found Plugins: + CommandLine (35531) + FastDraw (35499) + HouseNumberTaggingTool (35508) + Mapillary (1.5.25) + alignways (35474) + apache-commons (35524) + apache-http (35092) + buildings_tools (35563) + editgpx (35248) + ejml (35313) + geotools (35169) + jna (35092) + jts (35122) + splinex (35454) + turnrestrictions (35515) + utilsplugin2 (35487) + waydownloader (35405) Last errors/warnings: - 12044.373 E: Handled by bug report queue: java.lang.IllegalArgumentException: Listener org.openstreetmap.josm.actions.mapmode.DrawAction@25883e25 (instance of org.openstreetmap.josm.actions.mapmode.DrawAction) was not registered before or already removed. === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-0 (17) of main java.lang.IllegalArgumentException: Listener org.openstreetmap.josm.actions.mapmode.DrawAction@25883e25 (instance of org.openstreetmap.josm.actions.mapmode.DrawAction) was not registered before or already removed. at org.openstreetmap.josm.tools.ListenerList.failRemove(ListenerList.java:138) at org.openstreetmap.josm.tools.ListenerList.removeListener(ListenerList.java:132) at org.openstreetmap.josm.data.Preferences.removePreferenceChangeListener(Preferences.java:260) at org.openstreetmap.josm.actions.mapmode.MapMode.exitMode(MapMode.java:85) at org.openstreetmap.josm.actions.mapmode.DrawAction.exitMode(DrawAction.java:318) at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:498) at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:475) at org.openstreetmap.josm.actions.mapmode.MapMode.actionPerformed(MapMode.java:113) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
Attachments (1)
Change History (9)
comment:1 by , 4 years ago
Component: | Core → Plugin commandline |
---|---|
Owner: | changed from | to
comment:2 by , 4 years ago
comment:3 by , 4 years ago
Hm, forgot to install python, so maybe that is part of the problem?
2021-02-06 18:14:41.584 INFO: python ellipse.py 8.341860297496515,52.85673895373522 10 10 0 12 Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. 2021-02-06 18:14:41.940 WARNING: org.openstreetmap.josm.io.IllegalDataException: Line 1 column 1: Premature end of file.. Cause: org.xml.sax.SAXParseException: Premature end of file. org.openstreetmap.josm.io.IllegalDataException: Line 1 column 1: Premature end of file. at org.openstreetmap.josm.plugins.commandline.OsmToCmd.parseStream(OsmToCmd.java:71) at org.openstreetmap.josm.plugins.commandline.CommandLine.lambda$runTool$4(CommandLine.java:613) at java.lang.Thread.run(Thread.java:748) Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1014) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327) at org.openstreetmap.josm.plugins.commandline.OsmToCmd.parseStream(OsmToCmd.java:67) ... 2 more
comment:5 by , 4 years ago
I understand what's going wrong but I do not yet see how it ever worked well. As a work around: Switch to select mode before you use the command line.
comment:6 by , 4 years ago
Cc: | added |
---|
Problem is that the plugin command line field disables the draw mode to avoid short cut conflicts via DisableShortcutsOnFocusGainedTextField.disableMenuActions()
but pressing Esc doesn't re-enable the map mode before its method enterMode()
is called. In DrawAction.enterMode()
nothing is done if isEnabled()
returns false.
This seems to be special with DrawAction
, other MapMode implementations call super.enterMode()
no matter if they are enabled or not.
I have no idea why the plugin tries to enable the previous mode, I see no need for that. I'll attach a patch that simply removes the corresponding code and sets map mode to null (which seems to be equal to Select mode)
by , 4 years ago
Attachment: | 19936.patch added |
---|
I have no idea what the plugin should do but I can reproduce the error. Does anybody know a combination of JOSM version and plugin version that worked well?