graalvm-reachability-metadata icon indicating copy to clipboard operation
graalvm-reachability-metadata copied to clipboard

Add more metatdata for `org.glassfish.jaxb:jaxb-runtime:3.0.2`

Open linghengqian opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

  • Yes, refer to https://github.com/oracle/graalvm-reachability-metadata/pull/124

Describe the solution you'd like A clear and concise description of what you want to happen.

  • Currently, in the org.ehcache:ehcache:3.10.8-jakarta nativeTest process, part of jakarta.xml.bind:jakarta.xml.bind-api:3.0.1 and org.glassfish.jaxb:jaxb-runtime:3.0.2 GraalVM reachability metadata are manually maintained dependent. Adding corresponding GraalVM reachability metadata should be a reasonable behavior.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

  • It seems that writing unit tests for JAXB implementation is a troublesome thing, and we can almost only find ideas from Jakarta TCK. Jakarta EE 10 seems to offer GraalVM reachability metadata unsolicited, but that's too far from what Ehcache needs.

Additional context Add any other context or screenshots about the feature request here.

  • Just link to https://github.com/linghengqian/graalvm-trace-metadata-smoketest/issues/1 .

linghengqian avatar Dec 02 '22 06:12 linghengqian

  • Blocked by https://github.com/oracle/graalvm-reachability-metadata/pull/152#issuecomment-1359537797 .

linghengqian avatar Dec 21 '22 06:12 linghengqian

  • I will revisit the current issue after https://github.com/oracle/graalvm-reachability-metadata/issues/210 is resolved.

linghengqian avatar Feb 16 '23 08:02 linghengqian

I think I have the same problem in a SpringBoot native compile.

Sample project: https://github.com/steinsag/spring-native-xml

To reproduce:

git clone [email protected]:steinsag/spring-native-xml.git spring-native-xml
cd spring-native-xml
./mvnw spring-boot:build-image -Pnative
docker run --rm -p 8080:8080 spring-native-xml:0.0.1-SNAPSHOT

Execution of native image fails with following stacktrace:

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface jakarta.xml.bind.annotation.XmlAccessorType, interface org.glassfish.jaxb.core.v2.model.annotation.Locatable] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
        at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
        at com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:171) ~[na:na]
        at [email protected]/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:na]
        at [email protected]/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:na]
        at org.glassfish.jaxb.runtime.v2.model.annotation.LocatableAnnotation.create(LocatableAnnotation.java:53) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:92) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:29) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getClassOrPackageAnnotation(ClassInfoImpl.java:434) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getAccessType(ClassInfoImpl.java:446) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:293) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:159) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:219) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:72) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:52) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:185) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:67) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:52) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:332) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:347) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:415) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:255) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1115) ~[na:na]
        at org.glassfish.jaxb.runtime.v2.ContextFactory.createContext(ContextFactory.java:144) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at org.glassfish.jaxb.runtime.v2.JAXBContextFactory.createContext(JAXBContextFactory.java:44) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.2 - d104f19]
        at jakarta.xml.bind.ContextFinder.find(ContextFinder.java:368) ~[na:na]
        at jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:605) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.0]
        at jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:546) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:4.0.0]

I first posted this issue in https://github.com/spring-projects/spring-framework/issues/30021, but an analysis of Spring developers showed the issue is not on Spring's side.

steinsag avatar Feb 28 '23 20:02 steinsag

@steinsag I haven't had time to work on this issue recently. You can directly submit a PR containing unit tests and corresponding JSON entries.

linghengqian avatar Mar 01 '23 02:03 linghengqian

@linghengqian I collected some metadata of jaxb v4.0.3 and jakarta.xml.bind v4.01 based on those published in this repo in the various tests and enrichments to make docx4j work, can I share them?

nexus061 avatar Nov 07 '23 20:11 nexus061

@linghengqian I collected some metadata of jaxb v4.0.3 and jakarta.xml.bind v4.01 based on those published in this repo in the various tests and enrichments to make docx4j work, can I share them?

  • Your PRs are welcome. To close this issue in a PR, just add the description Fixes #137.

  • Due to my personal reasons, I personally cannot take the time to pay attention to this issue before July 2024.

linghengqian avatar Nov 08 '23 03:11 linghengqian