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.
<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.
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'
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"
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.
SHARE YOUR THOUGHTS WITH US!