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

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

Open
linghengqian opened this issue Dec 2, 2022 · 6 comments
Open

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

linghengqian opened this issue Dec 2, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@linghengqian
Copy link
Contributor

linghengqian commented Dec 2, 2022

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 [...]

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.

@linghengqian linghengqian added the enhancement New feature or request label Dec 2, 2022
@linghengqian linghengqian changed the title Add support for org.glassfish.jaxb:jaxb-runtime:3.0.2 Add more metatdata for org.glassfish.jaxb:jaxb-runtime:3.0.2 Dec 17, 2022
@linghengqian
Copy link
Contributor Author

@linghengqian
Copy link
Contributor Author

@steinsag
Copy link

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 git@github.com: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 java.base@17.0.6/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[services.progressit.springnativexml.SpringNativeXmlApplicationKt:na]
        at java.base@17.0.6/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 spring-projects/spring-framework#30021, but an analysis of Spring developers showed the issue is not on Spring's side.

@linghengqian
Copy link
Contributor Author

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

@nexus061
Copy link

nexus061 commented Nov 7, 2023

@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?

@linghengqian
Copy link
Contributor Author

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

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

No branches or pull requests

3 participants