Modify

Opened 5 years ago

Closed 5 years ago

#18287 closed defect (fixed)

CCE: class JsonStringImpl cannot be cast to class JsonNumber

Reported by: anonymous Owned by: Don-vip
Priority: normal Milestone: 19.11
Component: Core geojson Version:
Keywords: template_report Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. download https://matthew.davintech.ca/osm/city_address_out.json
  2. File > Open city_address_out.json

What is the expected result?

GeoJson loads properly or at least error saying were the file is corrupt.

What happens instead?

Get bug window, file does not import

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

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-11-01 23:59:01 +0100 (Fri, 01 Nov 2019)
Revision:15492
Build-Date:2019-11-01 22:59:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (15492 en_CA) Linux Ubuntu 19.10
Memory Usage: 1387 MB / 4096 MB (824 MB allocated, but free)
Java version: 11.0.5-ea+10-post-Ubuntu-0ubuntu1, Ubuntu, OpenJDK 64-Bit Server VM
Screen: :0.0 3840x2160
Maximum Screen Size: 3840x2160
Java package: openjdk-11-jre:amd64-11.0.5+10-0ubuntu1
Java ATK Wrapper package: libatk-wrapper-java:all-0.35.0-3
fonts-noto: fonts-noto:all-20181227-1
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]

Plugins:
+ Mapillary (1.5.20)
+ MicrosoftStreetside (35202)
+ QuickLabel (18)
+ SimplifyArea (34977)
+ apache-commons (35092)
+ apache-http (34908)
+ buildings_tools (35171)
+ colorscheme (34908)
+ conflation (0.6.4)
+ continuosDownload (82)
+ contourmerge (v0.1.5)
+ geochat (35163)
+ javafx-unixoid (34908)
+ jna (34908)
+ jts (35122)
+ measurement (35051)
+ reverter (35084)
+ tageditor (34977)
+ todo (30306)
+ turnlanes-tagging (281)
+ undelete (34977)
+ utilsplugin2 (35177)

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SlovakiaBicycleRoutes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Noname&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&zip=1

Validator rules:
+ https://raw.githubusercontent.com/stefan-a-bauer/josm-validators/master/mtb.validator.mapcss

Last errors/warnings:
- E: java.lang.UnsatisfiedLinkError: <josm.userdata>/plugins/javafx/libavplugin-54.so: libgstreamer-lite.so: cannot open shared object file: No such file or directory
- E: java.lang.UnsatisfiedLinkError: <josm.userdata>/plugins/javafx/libavplugin-ffmpeg-57.so: libgstreamer-lite.so: cannot open shared object file: No such file or directory
- E: java.lang.UnsatisfiedLinkError: <josm.userdata>/plugins/javafx/libavplugin-57.so: libgstreamer-lite.so: cannot open shared object file: No such file or directory
- E: java.lang.UnsatisfiedLinkError: <josm.userdata>/plugins/javafx/libavplugin-ffmpeg-56.so: libgstreamer-lite.so: cannot open shared object file: No such file or directory
- E: java.lang.UnsatisfiedLinkError: <josm.userdata>/plugins/javafx/libavplugin-56.so: libgstreamer-lite.so: cannot open shared object file: No such file or directory
- W: No configuration settings found.  Using hardcoded default values for all pools.
- E: Handled by bug report queue: java.lang.ClassCastException: class org.glassfish.json.JsonStringImpl cannot be cast to class javax.json.JsonNumber (org.glassfish.json.JsonStringImpl and javax.json.JsonNumber are in unnamed module of loader 'app')
- W: Region [WMS_BLOCK_v2] Resetting cache
- W: Region [WMTS_BLOCK_v2] Resetting cache
- E: Handled by bug report queue: java.lang.ClassCastException


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: main-worker-0 (86) of main
java.lang.ClassCastException: org.glassfish.json.JsonStringImpl cannot be cast to javax.json.JsonNumber
	at org.glassfish.json.JsonArrayBuilderImpl$JsonArrayImpl.getJsonNumber(JsonArrayBuilderImpl.java:410)
	at org.openstreetmap.josm.io.GeoJSONReader.getLatLon(GeoJSONReader.java:199)
	at org.openstreetmap.josm.io.GeoJSONReader.parsePoint(GeoJSONReader.java:204)
	at org.openstreetmap.josm.io.GeoJSONReader.parseGeometry(GeoJSONReader.java:172)
	at org.openstreetmap.josm.io.GeoJSONReader.parseFeature(GeoJSONReader.java:132)
	at org.openstreetmap.josm.io.GeoJSONReader.parseFeatureCollection(GeoJSONReader.java:124)
	at org.openstreetmap.josm.io.GeoJSONReader.parseRoot(GeoJSONReader.java:75)
	at org.openstreetmap.josm.io.GeoJSONReader.parse(GeoJSONReader.java:65)
	at org.openstreetmap.josm.io.GeoJSONReader.doParseDataSet(GeoJSONReader.java:337)
	at org.openstreetmap.josm.io.GeoJSONReader.parseDataSet(GeoJSONReader.java:351)
	at org.openstreetmap.josm.gui.io.importexport.GeoJSONImporter.parseDataSet(GeoJSONImporter.java:74)
	at org.openstreetmap.josm.io.GeoJSONServerReader.parseOsm(GeoJSONServerReader.java:34)
	at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.parseDataSet(DownloadOsmTask.java:441)
	at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.realRun(DownloadOsmTask.java:449)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Attachments (0)

Change History (5)

comment:1 by anonymous, 5 years ago

Note: other geojson load fine. (eg city_roads_out.json in the same location)

comment:2 by Don-vip, 5 years ago

Component: CoreCore geojson
Milestone: 19.11
Owner: changed from team to Don-vip
Status: newassigned
Summary: Trying to load geojsonCCE: class JsonStringImpl cannot be cast to class JsonNumber

comment:3 by Don-vip, 5 years ago

Description: modified (diff)

comment:4 by Don-vip, 5 years ago

This file encodes coordinates as strings instead of numbers:

["-75.748301129751894","45.351360495634701"]

comment:5 by Don-vip, 5 years ago

Resolution: fixed
Status: assignedclosed

In 15499/josm:

fix #18287 - more robust parsing of GeoJSON coordinates

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
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.