Modify

Opened 2 months ago

Last modified 3 weeks ago

#24447 new defect

Can't load large osm file

Reported by: pl71 Owned by: team
Priority: normal Milestone: 25.10
Component: Core Version: tested
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Load large osm file, abt 100 000 objects

What is the expected result?

Load and visualize

What happens instead?

Error:
JAXP00010003: The length of entity "[xml]" is "100 001" that exceeds the "100 000" limit set by "jdk.xml.maxGeneralEntitySizeLimit".

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

It happened after updating JVM

C:\Users\User>java -version
openjdk version "24.0.2" 2025-07-15
OpenJDK Runtime Environment GraalVM CE 24.0.2+11.1 (build 24.0.2+11-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 24.0.2+11.1 (build 24.0.2+11-jvmci-b01, mixed mode, sharing)

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2025-07-11 10:12:51 +0200 (Fri, 11 Jul 2025)
Revision:19423
Build-Date:2025-07-12 01:30:35
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19423 bg) Windows 10 64-Bit
OS Build number: Windows 10 Education 22H2 (19045)
Memory Usage: 1024 MB / 8192 MB (629 MB allocated, but free)
Java version: 24.0.2+11-jvmci-b01, GraalVM Community, OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080x32bpp@59Hz (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: Cp1251
Locale info: bg_BG
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-XX:ThreadPriorityPolicy=1, --module-path=D:\graaljs-24.1.1\lib, --add-modules=org.graalvm.polyglot,org.graalvm.word,org.graalvm.collections, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, --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]

Plugins:
+ Mapillary (1813)
+ apache-commons (36438)
+ conflation (273)
+ ejml (36438)
+ geotools (36438)
+ imagery_offset_db (36438)
+ jackson (36438)
+ jaxb (36438)
+ jts (36438)
+ opendata (36440)
+ pmtiles (36438)
+ reverter (36447)
+ scripting (v0.3.5)
+ splinex (36438)
+ urbaneye3d (1.2.0)
+ utilsplugin2 (36438)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewParkingFeatures&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1

Last errors/warnings:
- 00000.432 W: extended font config - overriding 'filename.Malgun_Gothic=malgun.ttf' with 'MALGUN.TTF'
- 00000.433 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.433 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'

Attachments (0)

Change History (8)

comment:1 by stoecker, 2 months ago

Please check your file with xmllint. I suspect it is broken.

comment:2 by pl71, 2 months ago

Xmllint doesn't complain. Additionally, this file can be opened in Notepad++ without any visual defects. The file was saved within JOSM. With the previous version of JAVA it was possible to be opened. I will try to investigate further.

comment:3 by pl71, 2 months ago

There were many (abt 70,000) escaped double quotes like " inside tags.
After replacing all of them with backtick (`) using Notepad++, JOSM loads this file without complaint.
You may close this ticket if you don't want to dig further.
The case is very specific and probably Java involved.

comment:4 by stoecker, 2 months ago

Can you share the file? If not too big attach it as .osm.xz?

comment:6 by taylor.smock, 7 weeks ago

It happened after updating JVM

Java version: 24.0.2+11-jvmci-b01, GraalVM Community, OpenJDK 64-Bit Server VM

Worked in the following versions:

  • 21.0.7+2, Flathub, OpenJDK 64-Bit Server VM

Did not work in the following version:

  • 24.0.2, Arch Linux, OpenJDK 64-Bit Server VM

Stack trace

org.openstreetmap.josm.io.IllegalDataException: Line 1 128 907 column 95: JAXP00010003: The length of entity "[xml]" is "100 001" that exceeds the "100 000" limit set by "jdk.xml.maxGeneralEntitySizeLimit".
	at org.openstreetmap.josm.io.OsmReader.lambda$doParseDataSet$0(OsmReader.java:518)
	at org.openstreetmap.josm.io.AbstractReader.doParseDataSet(AbstractReader.java:331)
	at org.openstreetmap.josm.io.AbstractReader.doParseDataSet(AbstractReader.java:314)
	at org.openstreetmap.josm.io.OsmReader.doParseDataSet(OsmReader.java:504)
	at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:554)
	at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:537)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.parseDataSet(OsmImporter.java:131)
	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)
[...]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1128907,95]
Message: JAXP00010003: The length of entity "[xml]" is "100 001" that exceeds the "100 000" limit set by "jdk.xml.maxGeneralEntitySizeLimit".
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652)
	at org.openstreetmap.josm.io.OsmReader.parseWayNodesAndTags(OsmReader.java:282)
	at org.openstreetmap.josm.io.AbstractReader.parseWay(AbstractReader.java:728)
	at org.openstreetmap.josm.io.OsmReader.parseWay(OsmReader.java:272)
	at org.openstreetmap.josm.io.OsmReader.parseOsm(OsmReader.java:175)
	at org.openstreetmap.josm.io.OsmReader.parseRoot(OsmReader.java:138)
	at org.openstreetmap.josm.io.OsmReader.parse(OsmReader.java:124)
	at org.openstreetmap.josm.io.OsmReader.lambda$doParseDataSet$0(OsmReader.java:507)
	... 49 more

2025-09-04 05:52:25.475 SEVERE: Error - <html>Could not read file 'cad.osm'.<br>Error is:<br>Line 1 128 907 column 95: JAXP00010003: The length of entity "[xml]" is "100 001" that exceeds the "100 000" limit set by "jdk.xml.maxGeneralEntitySizeLimit".</html>

This is caused by https://bugs.openjdk.org/browse/JDK-8343004 -- the JDK has decided to limit the default maximum XML size for memory/security reasons.

It looks like the workaround is -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 or

  • src/org/openstreetmap/josm/tools/XmlUtils.java

    diff --git a/src/org/openstreetmap/josm/tools/XmlUtils.java b/src/org/openstreetmap/josm/tools/XmlUtils.java
    a b  
    134134        factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
    135135        factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
    136136        factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
     137        // See #24447: Use the Java 23- defaults
     138        // For additional details, see also https://bugs.openjdk.org/browse/JDK-8343006
     139        factory.setProperty("jdk.xml.totalEntitySizeLimit", 50_000_000);
     140        factory.setProperty("jdk.xml.maxGeneralEntitySizeLimit", 0);
    137141        return factory;
    138142    }
    139143

comment:7 by stoecker, 3 weeks ago

Milestone: 25.1025.09

Ticket retargeted after milestone deleted

comment:8 by stoecker, 3 weeks ago

Milestone: 25.0925.10

Milestone renamed

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 pl71.
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.