Replies: 1 comment
-
It would appear that explicitly specifying that the XSD resource is on the classpath corrects the problem. Thus, if the include is rewritten as: BTW, if anybody is interested, the only other thing that was necessary to run a Quarkus-CXF web service as a native executable, was to @RegisterForReflection the following classes under the org.apache.cxf.jaxws.handler.types package: |
Beta Was this translation helpful? Give feedback.
-
I have a project that contains a Web Service definition through a WSDL file that is including the XSD types through an xsd:include element like so:
wsdl:types
<xsd:schema targetNamespace="http://www.example.com/" elementFormDefault="qualified">
<xsd:include schemaLocation="xsd/example.xsd" />
</xsd:schema>
</wsdl:types>
When running as a non-native executable, everything works fine. When running as a native executable, start up fails with the following error:
2022-12-02 09:42:16,001 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.io.FileNotFoundException: /home/quarkus/xsd/example.xsd (No such file or directory)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST_FileNotFoundException_constructor_970c509c6abfd3f98898b9a7521945418b90b270(JNIJavaCallWrappers.java:0)
at java.io.FileInputStream.open0(FileInputStream.java)
at java.io.FileInputStream.open(FileInputStream.java:219)
at java.io.FileInputStream.(FileInputStream.java:157)
at java.io.FileInputStream.(FileInputStream.java:112)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:652)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:150)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:860)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:830)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:654)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:610)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:320)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:255)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:165)
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:85)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:393)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at io.quarkiverse.cxf.transport.CxfHandler.(CxfHandler.java:143)
at io.quarkiverse.cxf.CXFRecorder.initServer(CXFRecorder.java:137)
at io.quarkus.deployment.steps.QuarkusCxfProcessor$startRoute2108765474.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.QuarkusCxfProcessor$startRoute2108765474.deploy(Unknown Source)
at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
at io.quarkus.runtime.Application.start(Application.java:101)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
at io.quarkus.runner.GeneratedMain.main(Unknown Source)
I have tried adding the properties:
without success (the example.xsd file resides under the path: src/main/resources/wsdl/xsd).
I am assuming the file is included in the native executable (I have not have had any problems with other files that are loaded from the classpath, such as resource bundles etc.), but somehow the code that reads the WSDL does not seem to find the file in the classpath and tries to load it from the filesystem - and of course fails. Inlining the schema works, but it would be much cleaner if the inclusion would work, as in the normal java packaging.
I am running version 1.0.0 of quarkus-cxf and RedHat's version 2.7 of Quarkus. Please advise.
Beta Was this translation helpful? Give feedback.
All reactions