Modify

Opened 25 hours ago

Last modified 17 hours ago

#24658 new defect

Opening of a Geojson file fails with ClassCastException

Reported by: viliam.durina@… Owned by: team
Priority: normal Milestone: 26.03
Component: Core Version: latest
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Open the attached geojson file

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

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2026-01-31 13:00:34 +0100 (Sat, 31 Jan 2026)
Revision:19481
Build-Date:2026-02-01 02:30:45
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19481 en_GB) Linux Ubuntu 24.04.4 LTS
Memory Usage: 460 MB / 7888 MB (184 MB allocated, but free)
Java version: 23.0.2+7-58, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 3840x2160x[Multi depth]@60Hz (scaling 2.00×2.00)
Maximum Screen Size: 3840×2160
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_GB.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: ubuntu:GNOME
libcommons-logging-java: libcommons-logging-java:all-1.3.0-1ubuntu1
fonts-noto: fonts-noto:-
VM arguments: [-Dsun.java2d.uiScale=2, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED]
Dataset consistency test: No problems found

Plugins:
+ buildings_tools (36474)
+ conflation (277)
+ jts (36474)
+ utilsplugin2 (36474)

Last errors/warnings:
- 03570.891 E: Handled by bug report queue: java.lang.ClassCastException: class org.eclipse.parsson.JsonObjectBuilderImpl$JsonObjectImpl cannot be cast to class jakarta.json.JsonArray (org.eclipse.parsson.JsonObjectBuilderImpl$JsonObjectImpl and jakarta.json.JsonArray are in unnamed module of loader 'app')



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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: main-worker-0 (46) of main
java.lang.ClassCastException: class org.eclipse.parsson.JsonObjectBuilderImpl$JsonObjectImpl cannot be cast to class jakarta.json.JsonArray (org.eclipse.parsson.JsonObjectBuilderImpl$JsonObjectImpl and jakarta.json.JsonArray are in unnamed module of loader 'app')
	at org.eclipse.parsson.JsonObjectBuilderImpl$JsonObjectImpl.getJsonArray(JsonObjectBuilderImpl.java:229)
	at org.openstreetmap.josm.io.GeoJSONReader.parseGeometry(GeoJSONReader.java:220)
	at org.openstreetmap.josm.io.GeoJSONReader.parseFeature(GeoJSONReader.java:164)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:727)
	at org.openstreetmap.josm.io.GeoJSONReader.parseFeatureCollection(GeoJSONReader.java:149)
	at org.openstreetmap.josm.io.GeoJSONReader.parseRoot(GeoJSONReader.java:100)
	at org.openstreetmap.josm.io.GeoJSONReader.parse(GeoJSONReader.java:87)
	at org.openstreetmap.josm.io.GeoJSONReader.doParseDataSet(GeoJSONReader.java:471)
	at org.openstreetmap.josm.io.GeoJSONReader.parseDataSet(GeoJSONReader.java:536)
	at org.openstreetmap.josm.gui.io.importexport.GeoJSONImporter.parseDataSet(GeoJSONImporter.java:36)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.loadLayer(OsmImporter.java:121)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.importData(OsmImporter.java:97)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.importData(OsmImporter.java:82)
	at org.openstreetmap.josm.gui.io.importexport.FileImporter.importDataHandleExceptions(FileImporter.java:103)
	at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:426)
	at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:354)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1575)

Attachments (1)

adresy_cifer4(1).geojson (891.4 KB ) - added by anonymous 24 hours ago.

Download all attachments as: .zip

Change History (3)

by anonymous, 24 hours ago

Attachment: adresy_cifer4(1).geojson added

comment:1 by anonymous, 24 hours ago

Found the root cause. It was missing coordinates at a few points, where my tool generated {}. E.g. this file fails:
`
{

"type": "FeatureCollection",
"features": [

{

"type": "Feature",
"geometry": {

"type": "Point",
"coordinates": {}

},
"properties": {
"ref:minvskaddress":"7102594532",
"addr:city":"Cífer",
"addr:place":"Cífer",
"addr:street":"Alejová",
"addr:conscriptionnumber":1466,
"addr:streetnumber":"4",
"addr:postcode":91943,
"addr:housenumber":"1466/4",
"addr:country":"SK"
}

}
]

}
`

This issue could be reported more cleanly, ideally with the line number.

comment:2 by stoecker, 17 hours ago

Milestone: 26.03

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to viliam.durina@….
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.