ciscoo / cxf-codegen-gradle

Gradle plugin to generate Java artifacts from WSDL
Apache License 2.0
26 stars 6 forks source link

Provider org.apache.cxf.jaxws.spi.ProviderImpl not found #51

Closed strelchm closed 1 year ago

strelchm commented 1 year ago

Hi! Help, please with my question. I have project with plugin:

apply plugin: 'io.mateo.cxf-codegen' with such dependencies for plugin:

dependencies {
    implementation 'javax.jws:javax.jws-api:1.1'
    cxfCodegen 'jakarta.xml.ws:jakarta.xml.ws-api:2.3.3'
    cxfCodegen 'jakarta.annotation:jakarta.annotation-api:1.3.5'
    cxfCodegen 'ch.qos.logback:logback-classic:1.2.10'
}

and project dependencies:

implementation group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.3'
implementation group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.3.3'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.3'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.3'
implementation group: 'com.sun.xml.ws', name: 'jaxws-ri', version: '2.3.3'
implementation 'com.sun.xml.ws:jaxws-rt:3.0.0'
implementation 'jakarta.xml.ws:jakarta.xml.ws-api:2.3.3'
implementation "jakarta.annotation:jakarta.annotation-api:1.3.5"
implementation 'javax.jws:javax.jws-api:1.1'
implementation 'com.sun.xml.messaging.saaj:saaj-impl:1.5.3'
implementation('org.apache.cxf:cxf-rt-frontend-jaxws:3.5.0') {
    force = true
    exclude group: 'asm', module: 'asm'
}
implementation 'org.apache.cxf:cxf-rt-transports-http-hc:3.5.0'
implementation("org.apache.cxf:cxf-rt-features-logging:3.5.0")
implementation('org.apache.cxf:cxf-rt-ws-security:3.5.0') {
    force = true
    exclude group: 'org.apache.geronimo.specs', module: 'geronimo-javamail_1.4_spec'
}

Soap service code is generated successfully but during sending SOA messages sometimes I have such exceptions: javax.xml.ws.WebServiceException: Provider org.apache.cxf.jaxws.spi.ProviderImpl not found\n\tat javax.xml.ws.spi.FactoryFinder$1.createException(FactoryFinder.java:61)\n\tat javax.xml.ws.spi.FactoryFinder$1.createException(FactoryFinder.java:58)\n\tat javax.xml.ws.spi.ServiceLoaderUtil.newInstance(ServiceLoaderUtil.java:103)\n\tat javax.xml.ws.spi.FactoryFinder.fromSystemProperty(FactoryFinder.java:122)\n\tat javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:99)\n\tat javax.xml.ws.spi.Provider.provider(Provider.java:96)\n\tat javax.xml.ws.Service.<init>(Service.java:112)

or

javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: Problem writing SAAJ model to stream: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not found\n\tat org.apache.cxf.jaxws.JaxWsClientProxy.mapException(JaxWsClientProxy.java:193)

I try to take dependencies from https://github.com/ciscoo/cxf-blockhound-webflux May be u have such situations when the SOAP providers did not found and you all suggest something. I tried to take path for this classes from arg variables but no result. Like the classloader works wrong

ciscoo commented 1 year ago

The project you linked was created specifically for investigating issue CXF-8410. It is no way meant to be used as a reference and is likely missing dependencies and/or configurations.

The issues you are facing are better suited to Stack Overflow. This issue tracker is primarily for bugs and enhancements for the io.mateo.cxf-codegen plugin, not application issues. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug with the code generation from io.mateo.cxf-codegen plugin specifically.