【发布时间】:2023-04-07 16:45:02
【问题描述】:
我正在使用 Spring 框架实现 JAX-WS。
以下是我的Spring applicationContext.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.dev.java.net/spring/servlet.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
但是,Eclipse 抱怨:
引用的文件包含错误 (http://jax-ws.dev.java.net/spring/servlet.xsd)。
经过调查,我找到了网址: http://jax-ws.dev.java.net/spring/servlet.xsd 不存在。 相反,它似乎要转移到: http://jax-ws.java.net/spring/servlet.xsd (您可以在浏览器中打开此链接)
因此,我从 http://jax-ws.dev.java.net/spring/servlet.xsd 到 http://jax-ws.java.net/spring/servlet.xsd
现在我的 applicationContext.xml 看起来像这样:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.java.net/spring/servlet.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
实际上,随着这种变化,Eclipse 错误消失了。 问题是在 Tomcat 7 中启动 Web 服务后,我收到以下运行时错误:
org.xml.sax.SAXParseException;行号:20;列号:29; schema_reference.4:未能读取架构文档'http://jax-ws.java.net/spring/servlet.xsd',因为 1) 找不到文档; 2) 文件无法读取; 3) 文档的根元素不是 . 在 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) 在 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:99) 在 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:433)
请指教。
非常感谢。 问候,
【问题讨论】:
-
您应该真正努力在生产应用程序中使用本地模式,否则您的应用程序将受制于这些不相关的第三方网络服务器。
标签: java web-services spring jax-ws