格式错误的Spring Bean XML文档仅在客户站点失败

时间:2018-09-05 08:30:33

标签: spring jboss cxf xerces

我有一个EAR应用程序,它轻而易举地部署在我们的Jboss环境中,并根据客户进行了配置(不是客户的映像)。

该应用程序包含由CXF Servlet加载的Spring Beans XML文件

<AmazonEnvelope>
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>ListingsContentHandler</MerchantIdentifier>
  </Header>
  <MessageType>Inventory</MessageType>
  <Message>
    <MessageID>0</MessageID>
    <OperationType>Update</OperationType>
    <Inventory>
      <SKU>588883</SKU>
      <Quantity>20</Quantity>
      <SwitchFullfilmentTo>MFN</SwitchFullfilmentTo>
    </Inventory>
  </Message>
</AmazonEnvelope>

Servlet代码(带空注释的Servlet类)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:sec="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:soap="http://cxf.apache.org/bindings/soap" xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" xmlns:cxf-beans="http://cxf.apache.org/configuration/beans" xmlns:cxf="http://cxf.apache.org/core"
       xmlns:cxf-policy="http://cxf.apache.org/policy" xmlns:cxf-soap="http://cxf.apache.org/bindings/soap"
       xsi:schemaLocation="http://www.springframework.org/schema/beans                https://www.springframework.org/schema/beans/spring-beans-4.3.xsd
                        http://www.springframework.org/schema/security             https://www.springframework.org/schema/security/spring-security-4.2.xsd
                        http://www.springframework.org/schema/context              https://www.springframework.org/schema/context/spring-context-4.3.xsd
                        http://www.springframework.org/schema/util                 https://www.springframework.org/schema/util/spring-util.xsd
                        http://www.springframework.org/schema/mvc                  https://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
                        http://www.springframework.org/schema/context              https://www.springframework.org/schema/context/spring-context-4.3.xsd
                        http://cxf.apache.org/core                                 https://cxf.apache.org/schemas/core.xsd
                        http://cxf.apache.org/jaxws                                https://cxf.apache.org/schemas/jaxws.xsd
                        http://cxf.apache.org/bindings/soap                        https://cxf.apache.org/schemas/configuration/soap.xsd
                        http://cxf.apache.org/transports/http/configuration        https://cxf.apache.org/schemas/configuration/http-conf.xsd
                        http://cxf.apache.org/policy                               https://cxf.apache.org/schemas/policy.xsd
                        http://cxf.apache.org/configuration/security               https://cxf.apache.org/schemas/configuration/security.xsd
                        http://cxf.apache.org/configuration/beans                  https://cxf.apache.org/schemas/configuration/cxf-beans.xsd
                        "
       profile="DEVELOPMENT_MODE"
>
    <jaxws:endpoint id="#ImiServiceSoap" implementor="com.acme.security.saintpaulimi.ServiceSoapMock" address="/ImiServiceSoap">
        <jaxws:binding>
            <soap:soapBinding style="document" use="literal" version="1.1"/>
        </jaxws:binding>
    </jaxws:endpoint>
</beans>

无论启用了模拟端点的Spring配置文件@WebServlet(name = "cxfPub", description = "Public WS /ws", urlPatterns = "/ws/*", loadOnStartup = 1, initParams = { @WebInitParam(name = "config-location", value = "classpath*:META-INF/context/servlet-publicWs/*-context.xml") }) public class PublicWsServlet extends CXFServlet ,由于Apache Xerces出现以下错误,应用程序都不会仅部署在客户站点上

DEVELOPMENT_MODE

我发现XML文档没有任何问题。我已经编辑了客户名称,但保留了行号。

此问题可能与Spring schemaLocation fails when there is no internet connection有关,因为可能需要对客户网络进行防火墙保护。但是我们正在使用Spring 4.3。

虽然我的问题可能与防火墙有关,但有两个事实适用:

  • DispatcherServlet的主要应用程序上下文(此处未显示)就像一个超级按钮。如果我从应用程序中删除PublicWsServlet和/或其关联的XML文件,它将启动
  • 我们正在使用Spring 4.3。在其他地方提到的地方,离线服务器的问题是通过修复Spring版本来解决的。

问题:我的XML文件有问题吗?是什么导致Jboss无法启动?

0 个答案:

没有答案