How to solve: javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/xml/ws/soap/SOAPFaultException

How to solve: javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/xml/ws/soap/SOAPFaultException

我在 jsp 网页中单击按钮时遇到了“javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/xml/ws/soap/SOAPFaultException”异常。

当我在 Eclipse 中 运行 它工作正常。所以我将它发布到 webapps 并在系统托盘中启动了 apache web 服务。 我访问了我配置的网址,JSP 页面工作正常,但是当我单击 jsp 网页中的按钮时,出现错误。

以下是错误消息的根本原因。

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/xml/ws/soap/SOAPFaultException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.index_jsp._jspService(index_jsp.java:213)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

java.lang.NoClassDefFoundError: javax/xml/ws/soap/SOAPFaultException
oss_api.oss.Search_the_license(oss.java:105)
org.apache.jsp.index_jsp._jspService(index_jsp.java:134)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

java.lang.ClassNotFoundException: javax.xml.ws.soap.SOAPFaultException
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1928)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1771)
oss_api.oss.Search_the_license(oss.java:105)
org.apache.jsp.index_jsp._jspService(index_jsp.java:134)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

上面的异常明明是没有包含依赖库,能不能把你项目正在使用的jar都列出来

您的项目中缺少的 jar 很可能是 jax-ws.jar