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

woodstox-core.jar 6.0.2 uses JDK-11 removed internal APIs #96

Closed
rohitgaikwad09 opened this issue Dec 1, 2019 · 8 comments · Fixed by #102
Closed

woodstox-core.jar 6.0.2 uses JDK-11 removed internal APIs #96

rohitgaikwad09 opened this issue Dec 1, 2019 · 8 comments · Fixed by #102
Milestone

Comments

@rohitgaikwad09
Copy link

  • The latest version of woodstox-core.jar 6.0.2 uses below JDK-11 removed internal APIs:

jdeps scan report:
digraph "woodstox-core-6.0.2.jar" {
"com.ctc.wstx.shaded.msv_core.driver.textui.Driver" -> "com.sun.org.apache.xml.internal.resolver.Catalog (JDK internal API (JDK removed internal API))";
"com.ctc.wstx.shaded.msv_core.driver.textui.Driver" -> "com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver (JDK internal API (JDK removed internal API))";
}

We are migrating our project to Java 11, Can someone please have a look into this issue?

@cowtowncoder
Copy link
Member

This usage is via MSV component, used for XML Schema validation.
But what is the specific problem you are having? Is there a failing use case to show something not working?

@rohitgaikwad09
Copy link
Author

Thanks cowtowncoder for your quick response!
Right now we are doing static scans using jdeps with Java 11.0.5 and there are no functional impact problems identified so far. However our project will be getting used by other users of which we are not known about the possible failures/usages that will hit the removed APIs.

A similar use case exists of same removed APIs in Metro JAXWS library, where they have fixed it for JDK 9+ builds.

Link: eclipse-ee4j/metro-jax-ws#86

Can you please have a look into it?

@cowtowncoder
Copy link
Member

No, I do not have time to do dig into this, ESPECIALLY given that it is -- as I mentioned -- in a 3rd party library Woodstox relies on (or dependency it has). This is a volunteer effort where users are usually participants so if you want to get it resolved, you will often need to do some work yourself. Just asking others to help you solve problem YOU ARE HAVING does not often yield good results.

@mads1980
Copy link

mads1980 commented Jan 21, 2020

Adding resolver-20050927.jar to the classpath fixes the issue with woodstox-core if anyone is interested.

@cowtowncoder
Copy link
Member

There is also version 6.0.3 available, although it seems unlikely that would matter in this case.

@kwin
Copy link
Contributor

kwin commented Feb 25, 2020

The same class leads to issues when embedding in an OSGi bundle, as scanning of that class file leads to the following (unwanted) Import-Package statements (https://issues.apache.org/jira/browse/JCRVLT-414):

  1. com.sun.org.apache.xml.internal.resolver
  2. com.sun.org.apache.xml.internal.resolver.tools
  3. org.apache.crimson.jaxp
  4. org.apache.xerces.jaxp
  5. oracle.xml.jaxp

Is it possible to exclude just the Driver from shading?

kwin added a commit to kwin/woodstox that referenced this issue Feb 25, 2020
cowtowncoder pushed a commit that referenced this issue Feb 27, 2020
@cowtowncoder cowtowncoder added this to the 6.1.0 milestone Feb 27, 2020
@cowtowncoder
Copy link
Member

cowtowncoder commented Feb 27, 2020

@kwin Hmmmmmmmh. I did release 6.1.0, but now seeing that upgrade to that would lead to failures with jackson-dataformat-xml with:

java.lang.NoClassDefFoundError: com/ctc/wstx/shaded/msv_core/driver/textui/Debug
	at com.ctc.wstx.shaded.msv_core.verifier.regexp.CombinedChildContentExpCreator.get(CombinedChildContentExpCreator.java:200)
	at com.ctc.wstx.shaded.msv_core.verifier.regexp.CombinedChildContentExpCreator.get(CombinedChildContentExpCreator.java:240)
	at com.ctc.wstx.shaded.msv_core.verifier.regexp.ExpressionAcceptor.createChildAcceptor(ExpressionAcceptor.java:137)
	at com.ctc.wstx.msv.GenericMsvValidator.validateElementStart(GenericMsvValidator.java:273)
	at com.ctc.wstx.sr.InputElementStack.resolveAndValidateElement(InputElementStack.java:529)
	at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:3058)
	at com.ctc.wstx.sr.BasicStreamReader.handleRootElem(BasicStreamReader.java:2188)
	at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2168)
	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1180)
	at com.fasterxml.jackson.dataformat.xml.vld.RelaxNGValidationTest.testValidWithNamespace(RelaxNGValidationTest.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:252)
	at junit.framework.TestSuite.run(TestSuite.java:247)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

Caused by: java.lang.ClassNotFoundException: 
com.ctc.wstx.shaded.msv_core.driver.textui.Debug
java.lang.ClassNotFoundException: com.ctc.wstx.shaded.msv_core.driver.textui.Debug
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.ctc.wstx.shaded.msv_core.verifier.regexp.CombinedChildContentExpCreator.get(CombinedChildContentExpCreator.java:200)
	at com.ctc.wstx.shaded.msv_core.verifier.regexp.CombinedChildContentExpCreator.get(CombinedChildContentExpCreator.java:240)
	at com.ctc.wstx.shaded.msv_core.verifier.regexp.ExpressionAcceptor.createChildAcceptor(ExpressionAcceptor.java:137)
	at com.ctc.wstx.msv.GenericMsvValidator.validateElementStart(GenericMsvValidator.java:273)
	at com.ctc.wstx.sr.InputElementStack.resolveAndValidateElement(InputElementStack.java:529)
	at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:3058)
	at com.ctc.wstx.sr.BasicStreamReader.handleRootElem(BasicStreamReader.java:2188)
	at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2168)
	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1180)
	at com.fasterxml.jackson.dataformat.xml.vld.RelaxNGValidationTest.testValidWithNamespace(RelaxNGValidationTest.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:252)
	at junit.framework.TestSuite.run(TestSuite.java:247)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

Did you actually tests that resulting jar works for validation using RelaxNG and W3C Schema?

@cowtowncoder
Copy link
Member

I think I will probably have to undo this change -- just very very unfortunate that I did release 6.1.0 already. :-(

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

Successfully merging a pull request may close this issue.

4 participants