Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 11 use gives a exception com/sun/xml/bind/Utils not found #114

Open
mgoel-uscis opened this issue May 31, 2020 · 4 comments
Open

Java 11 use gives a exception com/sun/xml/bind/Utils not found #114

mgoel-uscis opened this issue May 31, 2020 · 4 comments

Comments

@mgoel-uscis
Copy link

We have used with Java 8this plugin and so far had no issues but with an effort to migrate to Java 11 we are getting this exception - com/sun/xml/bind/Utils class not found.

We have included all possible combinations of dependencies as suggested by your plugin and others but to no avail.

// implementation "javax.xml.bind:jaxb-api:2.3.1"
// implementation "javax.xml.ws:jaxws-api:2.3.1"
// implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
// implementation "org.glassfish.main.javaee-api:javax.jws:3.1.2.2"
// implementation "com.sun.xml.messaging.saaj:saaj-impl:1.5.1"

implementation 'com.sun.xml.bind:jaxb-xjc:2.3.0.1'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'javax.xml.ws:jaxws-api:2.3.1'
implementation 'org.apache.cxf:cxf-rt-wsdl:3.2.7'
implementation 'javax.jws:javax.jws-api:1.1'

compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
compile group: 'org.glassfish.jaxb', name:'jaxb-runtime', version: '2.3.1'

I even added in libs folder jaxb-impl jar but it just does not pick up the jar file to resolve the class

so we use it like this

buildScript -
dependencies {
classpath 'no.nils:wsdl2java:0.12'

}

task -
wsdl2java {
wsdlsToGenerate = [
["$projectDir/src/main/resources/wsdl/VerificationServices.wsdl"]
]

}

plugins we add - id "no.nils.wsdl2java"

Please help us resolve this issue.

TIA

Regards

Manoj Goel

@legart
Copy link

legart commented Jun 2, 2020

Works for me if I add this to build.gradle:

wsdl2java("com.sun.xml.bind:jaxb-impl:2.3.3")

@yctang888
Copy link

This works for me:

wsdl2java 'org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.11.1'
wsdl2java 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.1'
wsdl2java "javax.xml.ws:jaxws-api:2.3.1"
wsdl2java "org.glassfish.jaxb:jaxb-runtime:2.3.1"
wsdl2java "org.glassfish.main.javaee-api:javax.jws:3.1.2.2"
wsdl2java "com.sun.xml.messaging.saaj:saaj-impl:1.5.1"
wsdl2java "javax.xml.bind:jaxb-api:2.3.1"
wsdl2java "com.sun.xml.bind:jaxb-core:2.3.0.1"
wsdl2java "org.glassfish.main.javaee-api:javax.jws:3.1.2.2"
wsdl2java "com.sun.xml.messaging.saaj:saaj-impl:1.5.1"
wsdl2java group: 'javax.activation', name: 'javax.activation-api', version: '1.2.0'

@robinstrom
Copy link

I got the same issue but it worked for me when I added:
wsdl2java "com.sun.xml.bind:jaxb-impl:2.3.2"

@kponichtera
Copy link

Since wsdl2java is used during Gradle build, another way can be adding jaxb-impl to the classpath during buildscript execution, like this:

buildscript {
    dependencies {
        classpath('com.sun.xml.bind:jaxb-impl:2.3.3')
    }
}

// ...

wsdl2java {
    wsdlsToGenerate = [
      // config omitted
    ]
}

This ensures that the jaxb-impl won't end up in the built package - it's used only during Gradle task execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants