【问题标题】:Exception in Apache Tomcat logs while deploying a Web Service leading to error: 404部署 Web 服务时 Apache Tomcat 日志中的异常导致错误:404
【发布时间】:2012-10-27 17:06:43
【问题描述】:

我在 apache tomcat 日志中收到此异常

SEVERE: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor:

结果我收到错误 404

这是我的 web.xml 文件

<web-app version="2.4" mlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<description>HelloWorld</description>
<display-name>HelloWorld</display-name>
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
<description>JAX-WS endpoint - HelloWorld</description>
<display-name>HelloWorld</display-name>
<servlet-name>HelloWorldPort</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorldPort</servlet-name>
<url-pattern>/helloWorld</url-pattern>
</servlet-mapping>

</web-app>

请有人告诉我我做错了什么

【问题讨论】:

    标签: tomcat jax-ws http-status-code-404


    【解决方案1】:

    您的 xml 命名空间不可解析(如异常所示)。比如你有

    mlns="http://java.sun.com/xml/ns/j2ee

    你应该有的地方

    xmlns="http://java.sun.com/xml/ns/j2ee

    因此,在该命名空间下定义的任何元素(例如 web-app)都会在编译描述符时导致运行时阻塞。

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 2014-12-17
      • 1970-01-01
      • 2015-06-09
      • 1970-01-01
      • 2018-02-04
      • 2015-05-27
      • 1970-01-01
      • 2014-08-14
      相关资源
      最近更新 更多