У меня есть проект micronaut от grpc, и у меня есть задача gradle для генерации java-классов из wsdl. Сборка прошла успешно, но когда я запускаю сервер grpc и вызываю метод, который использует один из сгенерированных классов, я получаю следующее error :
Caused by: java.lang.NullPointerException: null
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:85)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:218)
at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:161)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:129)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:99)
at javax.xml.ws.Service.<init>(Service.java:77)
Вот мой build.gradle
plugins {
id "io.spring.dependency-management" version "1.0.6.RELEASE"
id "com.google.protobuf" version "0.8.5"
id "java"
id "net.ltgt.apt-eclipse" version "0.21"
id "net.ltgt.apt-idea" version "0.21"
id "com.github.johnrengelman.shadow" version "4.0.2"
id "application"
id "no.nils.wsdl2java" version "0.10"
id "net.ltgt.apt" version "0.8"
id "groovy"
id "jacoco"
}
version "1.0.0"
group "com.myproject"
repositories {
mavenCentral()
maven { url "https://jcenter.bintray.com" }
}
dependencyManagement {
imports {
mavenBom 'io.micronaut:micronaut-bom:1.1.4'
}
}
configurations {
// for dependencies that are needed for development only
developmentOnly
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.2'
annotationProcessor "org.projectlombok:lombok:1.18.2"
annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor "io.micronaut:micronaut-validation"
compile "io.micronaut.grpc:micronaut-grpc-runtime"
compile "io.micronaut:micronaut-inject"
compile "io.micronaut:micronaut-validation"
compile "io.micronaut:micronaut-runtime"
runtime "ch.qos.logback:logback-classic:1.2.3"
compile "org.mapstruct:mapstruct:1.3.0.Final"
annotationProcessor "org.mapstruct:mapstruct-processor:1.3.0.Final"
compile group: 'org.apache.cxf', name: 'cxf-rt-bindings-soap', version: '3.3.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-frontend-jaxws', version: '3.0.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-transports-http', version: '3.3.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-ws-security', version: '3.1.11'
testCompileOnly platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation("org.spockframework:spock-core") {
exclude group: "org.codehaus.groovy", module: "groovy-all"
}
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut.test:micronaut-test-spock"
testImplementation "io.micronaut.test:micronaut-test-junit5"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.0"
}
test.classpath += configurations.developmentOnly
mainClassName = "com.myproject.Application"
ext {
protocVersion="3.5.1"
grpcVersion="1.18.0"
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
// use JUnit 5 platform
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
options.compilerArgs.add('-parameters')
}
shadowJar {
mergeServiceFiles()
}
wsdl2java{
wsdlsToGenerate = [
['-exsh', 'true','-p','com.myproject',
'-autoNameResolution',
"-b", "$projectDir/src/main/resources/wsdl/bindings.xml",
"$projectDir/src/main/resources/wsdl/v1_1.wsdl"]
]
wsdlDir = file("$projectDir/src/main/resources/wsdl")
locale = Locale.getDefault()
}
wsdl2javaExt {
cxfVersion = "3.3.2"
}
run.classpath += configurations.developmentOnly
run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
options.compilerArgs.add('-parameters')
}
jacocoTestReport {
reports {
html {
enabled true
}
}
afterEvaluate {
classDirectories.from = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/Application*',
'com/myproject/**'])
})
}
}
task buildWithCoverage {
dependsOn 'clean'
dependsOn 'cleanTest'
dependsOn 'test'
dependsOn 'jacocoTestReport'
tasks.findByName('cleanTest').mustRunAfter 'clean'
tasks.findByName('test').mustRunAfter 'cleanTest'
tasks.findByName('jacocoTestReport').mustRunAfter 'test'
}
Любая помощь?