Opened 3 years ago
Closed 2 years ago
#22733 closed defect (fixed)
[PATCH] Add UI feedback for url guessing, account for `nan` responses from servers
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | normal | Milestone: | 23.07 |
Component: | Core imagery | Version: | |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Try to add WMS layer
- Use this URL as GetCapabilities URL https://wms1.mapwise.com/cgi-bin/mapserv?map=maps/fmo-base-0-3.map
What is the expected result?
See layers available from the wms service
What happens instead?
error
Please provide any additional information below. Attach a screenshot if possible.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2023-01-29 21:53:34 +0100 (Sun, 29 Jan 2023) Revision:18646 Build-Date:2023-01-30 02:30:56 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (18646 en) Windows 11 64-Bit OS Build number: Windows 10 Home 2009 (22621) Memory Usage: 555 MB / 2048 MB (280 MB allocated, but free) Java version: 17.0.5+9-LTS-191, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 2560×1440 (scaling 1.25×1.25) \Display1 2560×1440 (scaling 1.25×1.25) Maximum Screen Size: 2560×1440 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: Cp1252 System property sun.jnu.encoding: Cp1252 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Last errors/warnings: - 00000.302 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF' - 00000.304 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF' - 00003.062 W: Unable to request certificate of https://roottest-g3.pkioverheid.nl - 00003.375 W: Unable to request certificate of https://roottest-g3.pkioverheid.nl - 00022.962 E: Handled by bug report queue: java.lang.NumberFormatException: For input string: "nan" === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-0 (23) of main java.lang.NumberFormatException: For input string: "nan" at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.base/java.lang.Double.parseDouble(Double.java:651) at org.openstreetmap.josm.io.imagery.WMSImagery.getDecimalDegree(WMSImagery.java:637) at org.openstreetmap.josm.io.imagery.WMSImagery.parseBBox(WMSImagery.java:628) at org.openstreetmap.josm.io.imagery.WMSImagery.parseExGeographic(WMSImagery.java:600) at org.openstreetmap.josm.io.imagery.WMSImagery.parseLayer(WMSImagery.java:525) at org.openstreetmap.josm.io.imagery.WMSImagery.parseLayer(WMSImagery.java:523) at org.openstreetmap.josm.io.imagery.WMSImagery.parseCapability(WMSImagery.java:457) at org.openstreetmap.josm.io.imagery.WMSImagery.attemptGetCapabilities(WMSImagery.java:422) at org.openstreetmap.josm.io.imagery.WMSImagery.<init>(WMSImagery.java:167) at org.openstreetmap.josm.gui.preferences.imagery.AddWMSLayerPanel.lambda$new$0(AddWMSLayerPanel.java:86) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389) at java.desktop/java.awt.Component.processEvent(Component.java:6391) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743) 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.pumpEventsForFilter(EventDispatchThread.java:117) at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234) at java.desktop/java.awt.Dialog.show(Dialog.java:1080) at java.desktop/java.awt.Component.show(Component.java:1728) at java.desktop/java.awt.Component.setVisible(Component.java:1675) at java.desktop/java.awt.Window.setVisible(Window.java:1036) at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1016) at org.openstreetmap.josm.gui.ExtendedDialog.setVisible(ExtendedDialog.java:462) at org.openstreetmap.josm.gui.ExtendedDialog.showDialog(ExtendedDialog.java:258) at org.openstreetmap.josm.gui.preferences.imagery.ImageryProvidersPanel$NewEntryAction.actionPerformed(ImageryProvidersPanel.java:476) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389) at java.desktop/java.awt.Component.processEvent(Component.java:6391) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743) 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.pumpEventsForFilter(EventDispatchThread.java:117) at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234) at java.desktop/java.awt.Dialog.show(Dialog.java:1080) at java.desktop/java.awt.Component.show(Component.java:1728) at java.desktop/java.awt.Component.setVisible(Component.java:1675) at java.desktop/java.awt.Window.setVisible(Window.java:1036) at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1016) at org.openstreetmap.josm.gui.preferences.PreferenceDialog.setVisible(PreferenceDialog.java:145) at org.openstreetmap.josm.actions.PreferencesAction.run(PreferencesAction.java:119) at org.openstreetmap.josm.actions.PreferencesAction.actionPerformed(PreferencesAction.java:104) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389) at java.desktop/java.awt.Component.processEvent(Component.java:6391) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743) 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)
Change History (10)
comment:1 by , 3 years ago
Component: | Core → Core imagery |
---|
follow-up: 4 comment:2 by , 3 years ago
comment:3 by , 3 years ago
I removed most of the layers in the MapServer map file powering the GetCapabilities request so it returned the XML in under 30 seconds and it worked correctly. So again, the iterations causing JOSM to report that I for sure found a bug should be reported as user error and provide helpful info as to how to resolve the issues:
A) Potentially automatically resolve the user error of not including the generic getcapabilities in the request parameter. Or specifically tell the user what needs to happen.
B) If the WMS server takes too long to respond, then say so - and provide an option for a longer timeout period.
comment:4 by , 3 years ago
Replying to bmay@…:
So I realize that I forgot to add extra parameters for the GetCapabilities call, but seems like:
A) JOSM could tack on the additional mostly generic parameters if missing, e.g &SERVICE=WMS&REQUEST=GetCapabilities&version=1.3.0
We do, actually, try several different URL patterns. The originating URL given (https://wms1.mapwise.com/cgi-bin/mapserv?map=maps/fmo-base-0-3.map
) does eventually resolve. It just takes a long time, since it looks like we wait for either a response or a timeout. We should probably add a progress monitor for this. This would be to allow us to (a) cancel and (b) not block the UI.
B) Its not really a software bug
Later...
I added the correct parameters and got another This is a bug... window - this time looks like the request is timing out. However, the server does eventually respond like after 3(?) minutes. Slower than it should be, but should it really be saying this is a software bug due to it not finishing in whatever time JOSM is set to wait for?
Maybe. By default, JOSM expects servers to respond within 30s. I think there is a setting somewhere to change it, but you really shouldn't.
comment:5 by , 3 years ago
Is there any particular reason why your server is returning map data (city_names2
and city_names3
) where nan
is set for a bounding lat/lon? It appears to violate the XSD document ( http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd ), specifically
[...snip...] <element name="EX_GeographicBoundingBox"> <annotation> <documentation> The EX_GeographicBoundingBox attributes indicate the limits of the enclosing rectangle in longitude and latitude decimal degrees. </documentation> </annotation> <complexType> <sequence> <element name="westBoundLongitude" type="wms:longitudeType"/> <element name="eastBoundLongitude" type="wms:longitudeType"/> <element name="southBoundLatitude" type="wms:latitudeType"/> <element name="northBoundLatitude" type="wms:latitudeType"/> </sequence> </complexType> </element> [...snip...] <simpleType name="longitudeType"> <restriction base="double"> <minInclusive value="-180"/> <maxInclusive value="180"/> </restriction> </simpleType> <simpleType name="latitudeType"> <restriction base="double"> <minInclusive value="-90"/> <maxInclusive value="90"/> </restriction> </simpleType> [...snip...]
Documentation indicates that the restriction entries minInclusive
/maxInclusive
for double
values in XSD documents excludes NaN
values.
by , 3 years ago
Attachment: | 22733.patch added |
---|
comment:6 by , 3 years ago
Summary: | Trying to add wms imagery layer fails → [PATCH RFC] Add UI feedback for url guessing, account for `nan` responses from servers |
---|
attachment:22733.patch does the following:
- Add a progress monitor for when we are trying to find the GetCapabilities URL for the server. It is cancellable, but it only takes affect after the current URL times out.
- I'm not a big fan of adding
gui
imports outside of thegui
package. It happens, but it will make modularization harder.
- I'm not a big fan of adding
- If the server returns a
nan
value for one of the lat/lons, returnnull
for the bounding boxnan
would not be an issue if the server followed the XSD documentation. It should be returningNaN
, notnan
orNAN
.
comment:7 by , 2 years ago
Milestone: | → 23.06 |
---|---|
Summary: | [PATCH RFC] Add UI feedback for url guessing, account for `nan` responses from servers → [PATCH] Add UI feedback for url guessing, account for `nan` responses from servers |
So I realize that I forgot to add extra parameters for the GetCapabilities call, but seems like:
A) JOSM could tack on the additional mostly generic parameters if missing, e.g &SERVICE=WMS&REQUEST=GetCapabilities&version=1.3.0
B) Its not really a software bug
Later...
I added the correct parameters and got another This is a bug... window - this time looks like the request is timing out. However, the server does eventually respond like after 3(?) minutes. Slower than it should be, but should it really be saying this is a software bug due to it not finishing in whatever time JOSM is set to wait for?
Please provide any additional information below. Attach a screenshot if possible.