Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

migration from jdk 8 to jdk 11 cxf generated sources unknown imports

I'm migrating from java 8 to 11 and I'm having a problem launching the springboot server:

nested exception is java.lang.NoClassDefFoundError: javax / jws / WebService.

I used in my pom.xml:

maven-compiler 3.8.0
cxf.version 3.3.0-SNAPSHOT

the compilation goes well but not the start of the server thank you

like image 368
Issam Lemlih Avatar asked Dec 11 '18 15:12

Issam Lemlih


1 Answers

JAX-WS is the library that provides javax.jws.WebService and related classes. It was supplied as part of Java SE 8 through 10, but removed for Java 11. You will need to get that library as an external dependency.

If you are using maven, you should be able to add a dependency on com.sun.xml.ws:jaxws-ri:<current-version> in your pom.xml:

<dependencies>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-ri</artifactId>
        <version>2.3.1</version>
    </dependency>
</dependencies>
like image 165
Andrew Janke Avatar answered Oct 14 '22 08:10

Andrew Janke