The specific error I am facing when starting my app on Tomcat9. Spring version: 5.1.5.RELEASE:
SEVERE: Error configuring application listener of class [org.springframework.web.context.request.RequestContextListener]
java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceRef
There are multiple answers on this error that all suggest adding maven dependencies. I have added these dependencies:
My build path:
The WebServiceRef
class is found in the package explorer:
This error shows in the console when starting the app on Tomcat9. Here is more of the stack trace:
SEVERE: Error configuring application listener of class [org.springframework.web.context.request.RequestContextListener]
java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceRef
at org.apache.catalina.core.DefaultInstanceManager.populateAnnotationsCache(DefaultInstanceManager.java:303)
...more stuf....
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Any help or suggestions would be much appreciated!
Update 1: Here are some .jar files that get copied into the final .war build under WEB-INF/lib. The 4 new maven dependencies and their versions are here, but there is also possible duplicate .jar files.
Update 2: Copying the jaws-api jar directly into my Tomcat Classpath resolved the runtime error... So the app is launching now, but how would I overcome this issue when actually deploying the .war file?