【问题标题】:SAXParseException - The matching wildcard is strict, but no declaration can be found for element 'jaxws:client'SAXParseException - 匹配的通配符是严格的,但找不到元素“jaxws:client”的声明
【发布时间】:2018-01-12 08:40:57
【问题描述】:

我仅在我的应用程序中使用 Spring 框架 4.3.9、Apache CFX 2.3.0 和 Maven 2.2.1。当我运行应用程序时,它运行良好,但是当我使用 Maven 3.x.x (3.3.1/3.5.2) 运行相同的应用程序时,出现以下错误。

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: nested exception is org.xml.sax.SAXParseException; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxws:client'.

以下是上下文 XML 的摘录

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://cxf.apache.org/jaxws  http://cxf.apache.org/schemas/jaxws.xsd
                           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

当我检查 tomcat webapps/app/lib 文件夹时,所有需要的 jars (cxf-api-2.3.0, cxf-codegen-plugin-2.3.0,cxf-tools-wsdlto-frontend-jaxws-2.3.0 ) 也被复制到那里。

如何解决?

【问题讨论】:

    标签: java spring maven cxf


    【解决方案1】:

    您是否尝试在xsi:schemaLocation 末尾添加上下文

    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd">
    

    如果你有其他命名空间声明,你也应该添加它们。

    【讨论】:

    • 尝试添加上下文架构位置,但仍然得到相同的错误。使用 maven 2.2.1 可以正常工作,但是使用 maven 3.x.x 会抛出此错误。
    猜你喜欢
    • 2012-08-26
    • 2021-11-02
    • 2017-10-20
    • 2014-08-07
    • 1970-01-01
    • 1970-01-01
    • 2015-12-05
    • 2011-08-28
    • 2012-11-18
    相关资源
    最近更新 更多