0

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.

Ikaro
  • 165
  • 1
  • 12
  • If you have a JavaFX project, check the Gluon client plugin https://docs.gluonhq.com, https://github.com/gluonhq/gluon-samples – José Pereda Mar 23 '21 at 00:18

1 Answers1

0

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.

Ikaro
  • 165
  • 1
  • 12