javaspringspring-bootmavenweb-services

Spring boot 3 : package javax.jws.soap does not exist


We have been migrating our app to Spring Boot 3. We see an error :

`package javax.jws does not exist

[ERROR] package javax.jws.soap does not exist [ERROR] cannot find symbol class WebService [ERROR] cannot find symbol symbol: class SOAPBinding`

when generating files from wsdl. I tried adding

    <dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.3.0.1</version>
</dependency>

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.3.0</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.2</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
    <version>2.3.0</version>
    <type>pom</type>
</dependency>

But the error still persists.Any pointers would be very helpful.Thanks

Sucessful build after resolving errors


Solution

  • Spring Boot 3 uses Jakarta EE 9, and you must migrate the rest of the application completely from javax to jakarta. This is stated in Spring Boot 3 migration guide.

    To help you migrate check the Open Rewrite recipe. You can run it from Maven command line.