1

This is driving me nuts. We are trying to use Java 11 with Spring Boot (to self host) and Apache CXF (for code-first SOAP development).

Is this combination just not possible?

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
        <version>3.3.2</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.3.2</version>
        <type>pom</type>
        <exclusions>
            <exclusion>
                <groupId>javax.activation</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.0</version>
    </dependency>
</dependencies>

Results in:

[ERROR] module java.xml.bind reads package javax.activation from both jakarta.activation and java.activation
[ERROR] module java.xml.soap reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module java.xml.ws reads package javax.activation from both java.activation and jakarta.activation
[ERROR] the unnamed module reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module spring.context reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module spring.boot.autoconfigure reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module spring.boot reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module java.annotation reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module java.activation reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module jakarta.activation reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module org.apache.cxf.core reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module org.apache.cxf.frontend.jaxws reads package javax.activation from both java.activation and jakarta.activation
[ERROR] module spring.beans reads package javax.activation from both java.activation and jakarta.activation

I have been adding and removing dependencies all week. Either I end up with a class not found error, a module not found error (for my own module), or the above. If I exclude the jakarta.activation module, I get compilation errors because another module depends on it.

Any ideas on the set of dependencies I can use to get this junk working?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Cypher
  • 2,608
  • 5
  • 27
  • 41
  • I am not very familiar with how Spring Boot handle runtime dependencies but can you try setting `jakarata` dependency as provided? – leopal Jul 25 '19 at 11:05

2 Answers2

-1

We are using Spring Boot, CXF, and Java 11 in one of our projects also. We had some problems because the current version of CXF still requires some sun and javax dependencies.

This are our working dependencies:

<dependency>
        <groupId>jakarta.xml.ws</groupId>
        <artifactId>jakarta.xml.ws-api</artifactId>
        <version>${jakarta.version}</version>
    </dependency>
    <dependency>
        <groupId>jakarta.xml.bind</groupId>
        <artifactId>jakarta.xml.bind-api</artifactId>
        <version>${jakarta.version}</version>
    </dependency>
    <dependency>
        <groupId>jakarta.jws</groupId>
        <artifactId>jakarta.jws-api</artifactId>
        <version>${jakarta.version}</version>
    </dependency>
    <dependency>
        <groupId>jakarta.activation</groupId>
        <artifactId>jakarta.activation-api</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>jakarta.xml.soap</groupId>
        <artifactId>jakarta.xml.soap-api</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.4.0-b180830.0359</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>3.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
        <version>3.4.2</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.ws</groupId>
        <artifactId>jaxws-api</artifactId>
        <version>2.3.1</version>
    </dependency>
    <dependency>
        <groupId>javax.jws</groupId>
        <artifactId>javax.jws-api</artifactId>
        <version>1.1</version>
    </dependency>

and some of the properties:

<properties>
    ...     
    <java.version>11</java.version>
    <springfox.swagger.version>3.0.0</springfox.swagger.version>
    <apache.cxf.version>3.3.0</apache.cxf.version>
    <jakarta.version>3.0.0</jakarta.version>
    ...
</properties>
-2
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.3.2</version>
        <type>pom</type>
    </dependency>
evrikom
  • 1
  • 1