简体   繁体   中英

Error building native image with GraalVM native-image-maven-plugin

I'm creating a native image for a JavaFX application using native-image-maven-plugin with GraalVm 21.0.0.2. When I try to execute it after the build end successfully I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.xerces.parsers.ObjectFactory
at org.apache.xerces.parsers.ObjectFactory.class$(Unknown Source) 
at org.apache.xerces.parsers.ObjectFactory.findClassLoader(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)

I appreciate any help you can give me.

Thanks to Jose Pereda comment I was able to build the native image using the Gluon plugin. I used the gluon plugin samples . But firs I needed to bump my code to parse XML using Stax instead of Sax: parse XML in java .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM