Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failures due to new JAXP limits in JDK 24 #4526

Open
cushon opened this issue Dec 12, 2024 · 3 comments
Open

Failures due to new JAXP limits in JDK 24 #4526

cushon opened this issue Dec 12, 2024 · 3 comments

Comments

@cushon
Copy link

cushon commented Dec 12, 2024

JDK 24 contains changes to JAXP limits, see: https://bugs.openjdk.org/browse/JDK-8343022

I'm seeing this cause failures in tycho-maven-plugin like the following

[ERROR] [68765fcb-a298-4bf4-9705-cc777c92e4d7][extension>org.eclipse.tycho:tycho-maven-plugin:4.0.10] Provisioning exception
org.eclipse.equinox.p2.core.ProvisionException: Unable to read repository at file:/usr/local/google/home/cushon/.m2/repository/.cache/tycho/https/download.eclipse.org/releases/mars/201506241002/content.xml.xz.
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryIO.read (MetadataRepositoryIO.java:84)
    at org.eclipse.equinox.internal.p2.metadata.repository.XZedSimpleMetadataRepositoryFactory.load (XZedSimpleMetadataRepositoryFactory.java:86)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad (MetadataRepositoryManager.java:63)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository (AbstractRepositoryManager.java:799)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository (AbstractRepositoryManager.java:697)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository (MetadataRepositoryManager.java:110)
    at org.eclipse.tycho.p2maven.transport.RemoteMetadataRepositoryManager.loadRepository (RemoteMetadataRepositoryManager.java:68)
...
Caused by: org.xml.sax.SAXParseException: JAXP00010003: The length of entity "[xml]" is "100,001" that exceeds the "100,000" limit set by "jdk.xml.maxGeneralEntitySizeLimit".
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1252)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse (SAXParserImpl.java:643)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryIO$Parser.parse (MetadataRepositoryIO.java:203)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryIO.read (MetadataRepositoryIO.java:66)
    at org.eclipse.equinox.internal.p2.metadata.repository.XZedSimpleMetadataRepositoryFactory.load (XZedSimpleMetadataRepositoryFactory.java:86)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad (MetadataRepositoryManager.java:63)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository (AbstractRepositoryManager.java:799)

Repro:

git clone https://github.com/google/google-java-format
wget https://download.java.net/java/early_access/jdk25/1/GPL/openjdk-25-ea+1_linux-x64_bin.tar.gz
tar xzvf openjdk-25-ea+1_linux-x64_bin.tar.gz
cd google-java-format
git checkout 88614098a58fea1bfe214c464fde019bd725c891
  • Update tycho version
git diff 88614098a58fea1bfe214c464fde019bd725c891
diff --git a/eclipse_plugin/pom.xml b/eclipse_plugin/pom.xml
index b2c6e36..acc0ad5 100644
--- a/eclipse_plugin/pom.xml
+++ b/eclipse_plugin/pom.xml
@@ -32,7 +32,7 @@

   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <tycho-version>3.0.5</tycho-version>
+    <tycho-version>4.0.10</tycho-version>
   </properties>

   <dependencies>
  • build
JAVA_HOME=$PWD/../jdk-25 mvn clean packag
@laeubi
Copy link
Member

laeubi commented Dec 12, 2024

@cushon thanks for the report, even though this is another limit than referenced in the bug it seems similar.

But actually this needs to be adjusted by p2 (what is the underlying library used by Tycho):

once it is addressed there we can update Tycho, in the meanwhile the only solution seem to raise the limit manually for the JDK.

@cushon cushon changed the title Failures due to new JAXP in JDK 24 Failures due to new JAXP limits in JDK 24 Dec 12, 2024
@merks
Copy link
Contributor

merks commented Dec 12, 2024

I had a look at https://download.eclipse.org/releases/mars/201506241002/content.jar and it looks like there are ~500,000 occurrences of & in that content.xml

$sed 's/&/&\n/g' < content.xml | grep -c '&'
526897

The value of applying a limit where no limit existed before is a bit incomprehensible... But is jdk.xml.maxGeneralEntitySizeLimit really the number of entities? It's more about the size. I just have a hard time imagine why one should limit the number of escaped characters.

@merks
Copy link
Contributor

merks commented Dec 12, 2024

I created an SDK installation with Java 24+26 and could reproduce this problem in the repository explorer. Only setting both of these properties in the eclipse.ini allows the repositories https://download.eclipse.org/releases/2024-12 or https://download.eclipse.org/releases/mars to load:

-Djdk.xml.totalEntitySizeLimit=1000000
-Djdk.xml.maxGeneralEntitySizeLimit=1000000

It's hard to test in a development environment with Java 24 being JDT doesn't recognize it properly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants