New Tutorials:   JAVASCRIPT    SASS/SCSS    PL/SQL  
CLOSE
   Java  Java11  
   Technology    Tricks

[SOLVED] Caused by: java.lang.ClassNotFoundException: javax.xml.ws.WebServiceFeature in Java 11

         
 JANUARY 21, 2020   by iamabhishek

For web applications created using JDK 1.8 or earlier version, migrating to the new versions of Java can be a pain because a lot of core changes have been introduced starting Java 9.

One such issue is ClassNotFoundException for JAXBException class [SOLVED] which is quite common and we have already covered its solution in one of our earlier post.

Once you have fixed the above issue by adding the jaxb-api, jaxb-impl, javax-activation-api and jaxb-core Jar files, there are chances that you must add one more JAR file which is specifically required for web applications.

So, if you see the following exception in the error logs,

Caused by: java.lang.ClassNotFoundException: javax.xml.ws.WebServiceFeature

You will have to add the jaxws-api JAR file to your project.


For Maven Projects:

If you are using Maven for handling dependencies in your Java project, you will have to add the following additional dependency in your pom.xml file.

<dependency>
    <groupId>javax.xml.ws</groupId>
    <artifactId>jaxws-api</artifactId>
    <version>2.3.1</version>
</dependency>

This will include the jaxws-api Jar file in your project when you will build your maven java project.


For Gradle Projects:

If you use Gradle to build your project, then add the following line to your build.gradle file,

compile group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.1'

For SBT Projects:

If you use SBT build tool to compile and build your java project, then add the following line to your build file,

libraryDependencies += "javax.xml.ws" % "jaxws-api" % "2.3.1"

For IVY Projects:

If you use ivy for building your java project, then add the following code line to your ivy.xml file:

<dependency org="javax.xml.ws" name="jaxws-api" rev="2.3.1"/>

Hope this solution helps you solve your problem.


RELATED POSTS



Subscribe and receive amazing posts directly in your inbox.