Modify ↓

Opened 25 hours ago

Closed 23 hours ago

#25067 closed defect (duplicate)

Crash bij opstarten in Territories.initializeExternalData

Reported by: mjeuring@… Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

What is the expected result?

What happens instead?

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

Revision:19678
Build-Date:2026-11-05 12:52:21

Identification: JOSM/1.5 (19678 nl) Windows 11 64-Bit
OS Build number: Windows 10 Pro 26H2 (26300)
Memory Usage: 256 MB / 9048 MB (107 MB allocated, but free)
Java version: 25.0.5+8-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080x32bpp@60Hz (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
Locale info: nl_NL
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.19678, -XX:MaxRAMPercentage=75.0, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --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, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe]

Last errors/warnings:
- 00000.413 W: extended font config - overriding 'filename.Malgun_Gothic=malgun.ttf' with 'MALGUN.TTF'
- 00000.413 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.414 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00001.723 E: java.security.KeyStoreException: Windows-ROOT not found. Oorzaak: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
- 00005.090 E: Handled by bug report queue: java.lang.ClassCastException: class org.eclipse.parsson.JsonStringImpl cannot be cast to class jakarta.json.JsonArray (org.eclipse.parsson.JsonStringImpl 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 (3)
java.lang.ClassCastException: class org.eclipse.parsson.JsonStringImpl cannot be cast to class jakarta.json.JsonArray (org.eclipse.parsson.JsonStringImpl 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.tools.Territories.lambda$initializeExternalData$2(Territories.java:204)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.openstreetmap.josm.tools.Territories.lambda$initializeExternalData$0(Territories.java:203)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:201)
	at org.openstreetmap.josm.tools.Territories.initializeExternalData(Territories.java:190)
	at org.openstreetmap.josm.tools.Territories.initialize(Territories.java:124)
	at org.openstreetmap.josm.gui.MainInitialization.lambda$beforeInitializationTasks$4(MainInitialization.java:85)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:108)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:73)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:1004)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:280)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:766)

Attachments (1)

josm-geofabrik-final.patch​ (6.8 KB ) - added by anonymous 23 hours ago.

Download all attachments as: .zip

Change History (7)

comment:1 by anonymous, 25 hours ago

I can confirm the same startup crash on another Windows 11 system.

Environment:

  • JOSM revision 19678 (de_DE)
  • Windows 11 Home 26H2 (build 26300)
  • Azul OpenJDK 25.0.5+8-LTS
  • Official Windows installer

The exception is identical:

java.lang.ClassCastException: org.eclipse.parsson.JsonStringImpl cannot be cast to jakarta.json.JsonArray

at Territories.initializeExternalData(Territories.java:204).

The issue also occurred with IcedTea-Web. Switching to the Windows installer and resetting the JOSM cache did not resolve it.

A PowerShell inspection of the Geofabrik JSON endpoint suggests that ISO 3166 properties may be represented as strings where arrays are expected.

This appears to be reproducible across different Windows installations and locales.

comment:2 by anonymous, 25 hours ago

Additional diagnostic finding: JOSM starts successfully when the network is disconnected.

I performed the following test on Windows 11 with JOSM revision 19678:

  1. Closed JOSM completely.
  2. Disconnected the computer from the network.
  3. Started JOSM using the official Windows installation.
  4. JOSM displayed the expected network errors (UnknownHostException) for the JOSM server and OpenStreetMap API.
  5. Despite these errors, JOSM completed startup successfully.
  6. Reconnected the network cable after startup. JOSM remained operational.

Result:

  • With an active internet connection: JOSM crashes during startup with ClassCastException in Territories.initializeExternalData().
  • Without an internet connection: JOSM starts successfully.
  • Reconnecting the internet after startup does not cause an immediate crash.

This strongly suggests that the crash is triggered by external data retrieved during initialization, possibly geofabrik-index-v1-nogeom.json.

The offline startup procedure provides a temporary workaround.

It would be useful to determine whether the external JSON data can be skipped or validated before parsing, so that JOSM can start normally even if the data format is unexpected.

comment:3 by anonymous, 24 hours ago

Workaround confirmed: replacing the cached Geofabrik JSON file resolves the startup crash.

I replaced the cached geofabrik-index-v1-nogeom.json file with the following minimal valid JSON:

`json
{"type":"FeatureCollection","features":[]}
`

JOSM revision 19678 now starts successfully with an active internet connection, including after closing and restarting the application a second time.

This strongly supports the hypothesis that the crash is caused by the processing of the external Geofabrik JSON data.

The workaround is temporary, as the cache may be refreshed automatically.

by anonymous, 23 hours ago

Attachment: josm-geofabrik-final.patch​ added

comment:4 by anonymous, 23 hours ago

This patch is a follow-up to the partial fix in r19696 (ticket #25045). The original crash is prevented, but regional Geofabrik taginfo functionality remains broken with the current JSON format.

I have attached a patch that extends the fix introduced in r19696.

While r19696 prevents the startup crash, regional Geofabrik taginfo data is still not loaded correctly because the current JSON index provides ISO-3166 properties as strings rather than arrays.

The patch:

  • Supports both JSON arrays and strings.
  • Handles comma-separated ISO codes and trims whitespace.
  • Ignores empty values and unsupported ISO property types.
  • Preserves the existing ISO3166-1/ISO3166-2 precedence.
  • Preserves compatibility with the previous array format.
  • Adds a regression test and a dedicated JSON fixture.

Verification:

  • JUnit: 6 tests passed.
  • Ant Checkstyle: successful.
  • Integration test against the current Geofabrik index: 554 features processed, resulting in 264 distinct ISO-code entries, matching an independent calculation.

The patch is based on SVN revision 19696 and changes only Territories.java, TerritoriesTest.java, and one new test fixture.

No unrelated changes are included.

Related ticket: #25067.

comment:5 by skorasaurus, 23 hours ago

Can confirm that the workaround at https://josm.openstreetmap.de/ticket/25067#comment:3 fixes (at least temporarily) the problem.

comment:6 by stoecker, 23 hours ago

Resolution: → duplicate
Status: new → closed

Closed as duplicate of #25045.

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.