Hi Olivier, We have an issue in the tracker [1] regarding GraalVM, the CXF team have not invested much into GraalVM's native image support just yet but it seems like it becomes increasingly more important. Would you mind please to add the details to the existing ticket so we could understand the problems and scope better. Which version of GraalVM and Java (8 or 11) are you using? Thank you.
[1] https://issues.apache.org/jira/browse/CXF-8340 Thursday, October 22, 2020, 7:40:07 AM, you wrote: od> Hello, od> I am writing the extension on quarkus for cxf. I have read a lot of the od> code on github cxf and fixed a lot of issues but I still failed with native od> compilation. od> I am not sure if it comes from jaxp or jaxb or cxf reflection. Anyway, an od> exception is thrown from cxf. od> I have an exception: od> *java.lang.RuntimeException: Invalid schema document passed to od> AbstractDataBinding.addSchemaDocument, not in W3C schema namespace: schema od> at * od> org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:111) od> at od> org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:68) od> at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:408) od> at od> org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) od> at od> org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469) od> at od> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:693) od> Analyze show that in AbstractDataBinding.addSchemaDocument the Document od> contain: od> <?xml version="1.0" encoding="UTF-8" standalone="no"?><schema xmlns:tns=" od> http://cxf.it.quarkus.io/" xmlns:xs="http://www.w3.org/2001/XMLSchema" od> targetNamespace="http://cxf.it.quarkus.io/" version="1.0"> od> <element name="reply" type="tns:reply"/> od> <element name="replyResponse" type="tns:replyResponse"/> od> <complexType name="reply"><sequence><element minOccurs="0" name="text" type="xs:string"/>></sequence></complexType> od> <complexType name="replyResponse"><sequence><element minOccurs="0" od> name="return" type="xs:string"/></sequence></complexType> od> </schema> od> Document.getDocumentElement() return a node Schema od> but .getNamespaceURI() return null. od> DOMSource domSource = new DOMSource(d); od> StringWriter writer = new StringWriter(); od> StreamResult result = new StreamResult(writer); od> TransformerFactory tf = TransformerFactory.newInstance(); od> Transformer transformer = null; od> try { od> transformer = tf.newTransformer(); od> transformer.transform(domSource, result); od> } catch (Exception e) { od> } od> Logger LOG = LogUtils.getL7dLogger(org.apache.cxf.endpoint.dynamic.TypeClassInitializer.class); od> LOG.info("DOCUMENT :"+ writer.toString()); od> LOG.info("DOCUMENT element :"+ d.getDocumentElement().toString()); od> LOG.info("DOCUMENT namespace :"+ d.getDocumentElement().getNamespaceURI()); od> return: od> DOCUMENT : [previous schema xml] od> DOCUMENT element :[schema: null] od> DOCUMENT namespace :null od> So, my question is: od> - is my schema badly valid ? od> - What is class which parse Document to produce the namespaceUri ? od> I was thinking the issue may come from package-info generation but it seems od> oki. od> Here is class decompilation from intelij: od> package io.quarkus.it.cxf.jaxws_asm; od> @javax.xml.bind.annotation.XmlSchema(namespace = od> "http://cxf.it.quarkus.io/", elementFormDefault = od> javax.xml.bind.annotation.XmlNsForm.QUALIFIED) od> interface $$package-info /* Real name is 'package-info' */ { od> } od> Here you have limitation of Graal in native: od> https://www.graalvm.org/reference-manual/native-image/Limitations/ od> First, here is my work: od> https://github.com/dufoli/quarkus-cxf od> 2 classes are very important: od> https://github.com/dufoli/quarkus-cxf/blob/master/deployment/src/main/java/io/quarkus/cxf/deployment/QuarkusCxfProcessor.java od> this one lists native documents and classname which need to been reflected. od> https://github.com/dufoli/quarkus-cxf/blob/master/runtime/src/main/java/io/quarkus/cxf/graal/CXFSubstitutions.java od> This one does substitution to remove class generation in CXF. od> Cheers, od> Olivier
