java.lang.NoClassDefFoundError: javax/activation/DataSource on wsimport Intellij java 9

前端 未结 4 629
再見小時候
再見小時候 2020-12-15 06:27

i\'m trying to generate class stubs for a wsdl with Intellij-Idea 2017.2.5 (Webservices -> Generate code from wsdl...) using JDK-9

I\'m getting this exception and i

相关标签:
4条回答
  • 2020-12-15 07:01

    I had the same problem. After changing the project jdk, it works for me.

    Change project jdk to 8.

    0 讨论(0)
  • 2020-12-15 07:02

    Just for other people with the same exception coming here:

    This problem can also occur if you use a web server such as tomcat and if you need the activation jar to be present there as well. One possible solution is to put it in the lib folder of tomcat (or to use the common.loader functionality).

    0 讨论(0)
  • 2020-12-15 07:12

    Based on your error message, you need to add the following dependency in your pom.xml

    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>
    

    From SDK 9, for JAXB to work for web services you need to also have the following dependencies if you do not already have them as they are not part of the SDK.

    <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>
    
    0 讨论(0)
  • 2020-12-15 07:12

    I guess it can be useful. I have these additional packages in my soap project when switch from Java 8 to 10. Gradle:

    compile "javax.xml.bind:jaxb-api:2.3.0"
    compile "javax.activation:activation:1.1"
    compile "com.sun.xml.bind:jaxb-impl:2.3.0"
    compile "com.sun.xml.bind:jaxb-core:2.3.0"
    compile "com.sun.xml.ws:rt:2.3.0"
    compile "com.sun.xml.ws:jaxws-rt:2.3.0"
    
    0 讨论(0)
提交回复
热议问题