-
-
Notifications
You must be signed in to change notification settings - Fork 176
Xerces detection regressed in 2.68.0 #541
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
Comments
@NotMyFault - yes is was my :-) Have made a SNAPSHOT build (2.69.0-SNAPSHOT). Thanks |
@NotMyFault (proud to help to test jenkins) |
2.69.0 is out |
Unfortunately with 2.69.0 the Xerces detection is working on Java 11 but failing on Java 17 as can be observed running
The following patch seems to solve the issue diff --git a/src/main/java/com/gargoylesoftware/htmlunit/platform/Platform.java b/src/main/java/com/gargoylesoftware/htmlunit/platform/Platform.java
index aa0814e7ad..07b191dee6 100644
--- a/src/main/java/com/gargoylesoftware/htmlunit/platform/Platform.java
+++ b/src/main/java/com/gargoylesoftware/htmlunit/platform/Platform.java
@@ -51,7 +51,7 @@ public final class Platform {
HelperSunXerces_ = (XmlUtilsHelperAPI)
Class.forName("com.gargoylesoftware.htmlunit.platform.util.XmlUtilsSunXercesHelper").newInstance();
}
- catch (final Exception e) {
+ catch (final Exception | LinkageError e) {
// ignore
}
@@ -60,7 +60,7 @@ public final class Platform {
HelperXerces_ = (XmlUtilsHelperAPI)
Class.forName("com.gargoylesoftware.htmlunit.platform.util.XmlUtilsXercesHelper").newInstance();
}
- catch (final Exception e2) {
+ catch (final Exception | LinkageError e2) {
// ignore
}
}
diff --git a/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsSunXercesHelper.java b/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsSunXercesHelper.java
index 84a2b2dee5..2001c29660 100644
--- a/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsSunXercesHelper.java
+++ b/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsSunXercesHelper.java
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
@@ -38,6 +39,11 @@ public final class XmlUtilsSunXercesHelper implements XmlUtilsHelperAPI {
// private static final Log LOG = LogFactory.getLog(XmlUtilsXerces.class);
+ public XmlUtilsSunXercesHelper() {
+ // Force eager loading of classes in order to flush out any linkage errors early
+ Objects.hash(DeferredDocumentImpl.class, DeferredNode.class);
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsXercesHelper.java b/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsXercesHelper.java
index 1c2d7f0746..787b2a99c9 100644
--- a/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsXercesHelper.java
+++ b/src/main/java/com/gargoylesoftware/htmlunit/platform/util/XmlUtilsXercesHelper.java
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import org.apache.xerces.dom.DeferredDocumentImpl;
import org.apache.xerces.dom.DeferredNode;
@@ -38,6 +39,11 @@ public final class XmlUtilsXercesHelper implements XmlUtilsHelperAPI {
// private static final Log LOG = LogFactory.getLog(XmlUtilsXerces.class);
+ public XmlUtilsXercesHelper() {
+ // Force eager loading of classes in order to flush out any linkage errors early
+ Objects.hash(DeferredDocumentImpl.class, DeferredNode.class);
+ }
+
/**
* {@inheritDoc}
*/ Once you have a solution committed, let me know and I will try it against |
@basil sorry for that. |
@basil @NotMyFault |
Thank you, I tested the new version by running It would be nice if you could delete the calls to |
Done - snapshot updated. |
@basil thanks for the hint! |
You are welcome. I just repeated the same matrix of 4 tests, and all works well. If you are ready for a release, go for it! 👍 |
@basil the plan is to do this tomorrow |
2.70.0 is out - hope the problem are finally fixed. |
@rbri We have successfully upgraded to 2.70.0 in the Jenkins plugin parent POM and Jenkins core. Many thanks for your coöperation! |
Uh oh!
There was an error while loading. Please reload this page.
Hey @rbri,
Great to see that the Xerces detection has already been fixed in c1028b0.
Would you mind cutting a release, please? This regression currently impacts various test suites in the Jenkins project.
Thanks in advance!
The text was updated successfully, but these errors were encountered: