简体   繁体   English

Spring cvc-elt.1:找不到元素'beans'的声明和类似的问题

[英]Spring cvc-elt.1: Cannot find the declaration of element 'beans' and similar problems

since some days I got this strange problem with spring 4.3.3 . 因为有些日子我在春季4.3.3遇到了这个奇怪的问题。 On deploy (both in DEV and in a Test environment the server produces alternately these 2 errors 在部署时(在DEV和测试环境中,服务器交替产生这两个错误

Error #1. 错误#1。 It comes when I'm over a proxy or an internet connection is not available 当我通过代理或互联网连接不可用时

Ignored XML validation warning: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 108; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

and then 接着

 Context initialization failed: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/jboss-as-spring-mvc-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 108; cvc-elt.1: Cannot find the declaration of element 'beans'.

Error #2. 错误#2。 It comes when a connection is available (or was available) 当连接可用(或可用)时

 JBWEB000289: Servlet pdaServlet threw load() exception: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]

Offending resource: ServletContext resource [/WEB-INF/jboss-as-spring-mvc-context.xml] 违规资源:ServletContext资源[/WB-INF/jboss-as-spring-mvc-context.xml]

Independently from the exception thrown the system WORKS anyway, probably due to the fact that the spring configuration is split in 3 files and the first 2 load correctly. 无论如何,独立于抛出系统WORKS的异常,可能是由于弹簧配置被拆分为3个文件而前2个正确加载。 But I'd like to understand what's happening. 但我想了解发生了什么。 I've seen a LOT of responses on both these topics, but none applies to my case. 我已经看到很多关于这两个主题的回复,但没有一个适用于我的情况。

Here's my configuration: 这是我的配置:

WEB.XML WEB.XML

    <?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
         http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
         metadata-complete="true">

 <display-name>Java EE 6 Starter Application</display-name>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:/META-INF/spring/applicationContext.xml,
                classpath:/META-INF/spring/infrastructure.xml</param-value>
  </context-param>

  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>com.myCloud.pda.listener.InitContextListener</listener-class>
  </listener>

  <servlet>
    <servlet-name>pdaServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/jboss-as-spring-mvc-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <multipart-config>
   <location>/</location>
   <max-file-size>734003200</max-file-size>
   <max-request-size>2936012800</max-request-size>
   <file-size-threshold>0</file-size-threshold>
  </multipart-config>
  </servlet>
  ...

applicationContext.xml (loads OK) applicationContext.xml(加载OK)

    <?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations" value="file:${JbossApps.confPath}/pda/pda.properties"/>
</bean>

<bean id="eventListenerBean" class="com.myCloud.initializer.MultimediaApplicationListener" />


<context:component-scan base-package="com.myCloud.pda.mvc"/>

....

Infrastructure.xml (Loads OK) Infrastructure.xml(加载OK)

    <?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:jee="http://www.springframework.org/schema/jee"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/tx
           http://www.springframework.org/schema/tx/spring-tx.xsd
           http://www.springframework.org/schema/jee 
           http://www.springframework.org/schema/jee/spring-jee.xsd">

    <!-- JDNI name for EntityManagerFactory is defined in src/main/resources/META-INF/persistence.xml -->
    <jee:jndi-lookup jndi-name="java:jboss/pda/persistence" id="entityManagerFactory"
                     expected-type="javax.persistence.EntityManagerFactory" />

....

jboss-as-spring-mvc-context.xml (Exception) jboss-as-spring-mvc-context.xml(例外)

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


     <context:component-scan base-package="com.myCloud.pda.mvc"/>


    <mvc:annotation-driven />

    .....

POM.XML 的pom.xml

  <properties>
                <!-- Spring version -->
        <version.spring>4.3.3.RELEASE</version.spring>
        <version.poi>3.17</version.poi>
        <!-- Spring Third Party dependencies -->
        <version.aopalliance>1.0</version.aopalliance>

 .....
 <dependencyManagement>

    <dependencies>

  ....
  <!-- Spring dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-asm</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${version.spring}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${version.spring}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${version.spring}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${version.spring}</version>
        </dependency>

       .....
            </dependencies>
    </dependencyManagement>
     <dependencies>
      .....
  <!-- Import Spring dependencies, these are either from community or versions
        certified in WFK2 -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
    </dependency>
    <!-- 
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
    </dependency>
     -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-expression</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>

Additional Notes 补充笔记

1- When having the error #1 I see from the startup logs this message when processing applicationContext.xml 1-当出现错误#1时,我从启动时看到处理applicationContext.xml时记录此消息

Loading XML bean definitions from class path resource [META-INF/spring/applicationContext.xml]
23:47:22,797 DEBUG [org.springframework.beans.factory.xml.DefaultDocumentLoader] (ServerService Thread Pool -- 23) Using JAXP provider [__redirected.__DocumentBuilderFactory]
23:47:22,813 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] (ServerService Thread Pool -- 23) Loading schema mappings from [META-INF/spring.schemas]
23:47:22,813 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] (ServerService Thread Pool -- 23) Loaded schema mappings: {http://www.springframework.org/schema/tx/spring-tx-4.3.xsd=org/springframework/transaction/config/spring-tx-4.3.xsd, http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/cache/spring-cache-4.2.xsd=org/springframework/cache/config/spring-cache-4.2.xsd, http://www.springframework.org/schema/aop/spring-aop-4.1.xsd=org/springframework/aop/config/spring-aop-4.1.xsd, http://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd, http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd=org/springframework/web/servlet/config/spring-mvc-4.1.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://cxf.apache.org/schemas/configuration/http-conf.xsd=schemas/configuration/http-conf.xsd, http://cxf.apache.org/configuration/parameterized-types=schemas/configuration/parameterized-types.xsd, http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd=schemas/xmldsig-core-schema.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-4.3.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://www.w3.org/2006/07/ws-policy.xsd=schemas/ws-policy-200607.xsd, http://www.springframework.org/schema/lang/spring-lang-4.1.xsd=org/springframework/scripting/config/spring-lang-4.1.xsd, http://www.springframework.org/schema/context/spring-context-4.0.xsd=org/springframework/context/config/spring-context-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-4.2.xsd=org/springframework/beans/factory/xml/spring-beans-4.2.xsd, http://www.springframework.org/schema/tool/spring-tool-4.1.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.2.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.2.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-4.1.xsd=org/springframework/ejb/config/spring-jee-4.1.xsd, http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd=schemas/configuration/wsrm-manager.xsd, http://www.springframework.org/schema/task/spring-task-4.2.xsd=org/springframework/scheduling/config/spring-task-4.2.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-4.3.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/tx/spring-tx-4.2.xsd=org/springframework/transaction/config/spring-tx-4.2.xsd, http://www.springframework.org/schema/cache/spring-cache-4.1.xsd=org/springframework/cache/config/spring-cache-4.1.xsd, http://schemas.xmlsoap.org/ws/2004/08/addressing=schemas/wsdl/addressing.xsd, http://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.2.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd=schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd=org/springframework/web/servlet/config/spring-mvc-4.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/util/spring-util-4.3.xsd=org/springframework/beans/factory/xml/spring-util-4.3.xsd, http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-4.0.xsd=org/springframework/scripting/config/spring-lang-4.0.xsd, http://schemas.xmlsoap.org/wsdl/=schemas/wsdl/wsdl.xsd, http://cxf.apache.org/schemas/bindings/object.xsd=schemas/bindings/object.xsd, http://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-4.3.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd=org/springframework/web/servlet/config/spring-mvc-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-4.1.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-4.0.xsd=org/springframework/beans/factory/xml/spring-tool-4.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/lang/spring-lang-3.1.xsd=org/springframework/scripting/config/spring-lang-3.1.xsd, http://www.springframework.org/schema/cache/spring-cache-3.1.xsd=org/springframework/cache/config/spring-cache-3.1.xsd, http://www.springframework.org/schema/jee/spring-jee-4.0.xsd=org/springframework/ejb/config/spring-jee-4.0.xsd, http://cxf.apache.org/schemas/configuration/jms.xsd=schemas/configuration/jms.xsd, http://www.springframework.org/schema/task/spring-task-4.1.xsd=org/springframework/scheduling/config/spring-task-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://schemas.xmlsoap.org/wsdl/http/=schemas/wsdl/http.xsd, http://www.springframework.org/schema/tx/spring-tx-4.1.xsd=org/springframework/transaction/config/spring-tx-4.1.xsd, http://cxf.apache.org/schemas/wsdl/jms.xsd=schemas/wsdl/jms.xsd, http://www.springframework.org/schema/cache/spring-cache-4.0.xsd=org/springframework/cache/config/spring-cache-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.1.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd=schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd, http://cxf.apache.org/schemas/configuration/parameterized-types.xsd=schemas/configuration/parameterized-types.xsd, http://www.springframework.org/schema/task/spring-task-3.2.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/util/spring-util-4.2.xsd=org/springframework/beans/factory/xml/spring-util-4.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-4.3.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd=schemas/configuration/wsrm-policy.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans-4.0.xsd=org/springframework/beans/factory/xml/spring-beans-4.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-4.3.xsd, [omitted for brevity]
23:47:22,813 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] (ServerService Thread Pool -- 23) Found XML schema [http://www.springframework.org/schema/beans/spring-beans.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-4.3.xsd
23:47:22,828 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] (ServerService Thread Pool -- 23) Found XML schema [http://www.springframework.org/schema/context/spring-context.xsd] in classpath: org/springframework/context/config/spring-context-4.3.xsd
23:47:22,828 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] (ServerService Thread Pool -- 23) Found XML schema [http://www.springframework.org/schema/tool/spring-tool-4.3.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-4.3.xsd
23:47:22,828 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] (ServerService Thread Pool -- 23) Found XML schema [http://www.springframework.org/schema/tx/spring-tx.xsd] in classpath: org/springframework/transaction/config/spring-tx-4.3.xsd
23:47:22,844 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] (ServerService Thread Pool -- 23) Loading bean definitions
23:47:22,859 DEBUG [org.springframework.beans.factory.xml.BeanDefinitionParserDelegate] (ServerService Thread Pool -- 23) Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0]
23:47:22,875 DEBUG [org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] (ServerService Thread Pool -- 23) Loaded NamespaceHandler mappings: {http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler, http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.w3.org/2006/07/ws-policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler, http://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler, http://cxf.apache.org/policy=org.apache.cxf.ws.policy.spring.NamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://cxf.apache.org/transports/jms=org.apache.cxf.transport.jms.spring.NamespaceHandler, http://cxf.apache.org/transports/http/configuration=org.apache.cxf.transport.http.spring.NamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, 

which is correct (similar for infrastructure.xml). 这是正确的(类似于infrastructure.xml)。 Instead this message when processing jboss-as-spring-mvc-context.xml 而是处理jboss-as-spring-mvc-context.xml时的此消息

   23:47:24,360 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] (ServerService Thread Pool -- 23) Loading bean definitions
    23:47:24,361 DEBUG [org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] (ServerService Thread Pool -- 23) Loaded NamespaceHandler mappings: {}

2- When having the error #2 if I change xmlns:context in xmlns:context2 in jboss-as-spring-mvc-context.xml , we fall back in the error #1 . 2-当我在jboss-as-spring-mvc-context.xml中的xmlns:context2中更改xmlns:context时出现错误#2时,我们会回到错误#1中。

3- This spring configuration infrastructure (with the 3 files ) is shipped with JBOSS Development Studio as a Maven SPring Project 3-这个Spring配置基础设施(包含3个文件)随JBOSS Development Studio一起作为Maven SPring项目提供

4- The same spring configuration infrastructure does not have these problems with other projects 4-相同的弹簧配置基础结构与其他项目没有这些问题

I'd like to solve the issue, event if it does not have practical consequences 如果没有实际后果,我想解决这个问题

Looks like you missed a library with *.xsd files for one of used namespaces. 看起来你错过了一个带有* .xsd文件的库,用于其中一个使用过的命名空间。 Only in that case Spring will tries to load an xsd file from external url. 只有在这种情况下,Spring才会尝试从外部URL加载xsd文件。

This article could help to understand the whole algorithm: http://blog.harmonysoft.tech/2010/01/spring-xsd-loading-algorithm.html 本文可以帮助理解整个算法: http//blog.harmonysoft.tech/2010/01/spring-xsd-loading-algorithm.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring:-cvc-elt.1:找不到元素“ beans”的声明 - Spring :- cvc-elt.1: Cannot find the declaration of element 'beans' cvc-elt.1:找不到元素“beans”的声明 - cvc-elt.1: Cannot find the declaration of element 'beans' 错误:cvc-elt.1:找不到元素“beans”的声明 - Error: cvc-elt.1: Cannot find the declaration of element 'beans' 在Spring应用程序中遇到错误:cvc-elt.1:找不到元素&#39;beans&#39;的声明 - Getting an error in spring application: cvc-elt.1: Cannot find the declaration of element 'beans' 使用spring获取错误消息“cvc-elt.1:找不到元素'beans'的声明。” - Getting error message with spring “cvc-elt.1: Cannot find the declaration of element 'beans'.” org.xml.sax.SAXParseException; lineNumber:6; columnNumber:122; cvc-elt.1:找不到元素&#39;beans&#39;的声明 - org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 122; cvc-elt.1: Cannot find the declaration of element 'beans' cvc-elt.1:找不到RootElement的元素声明 - cvc-elt.1: Cannot find the declaration of element for RootElement cvc-elt.1:找不到元素&#39;NewIssue&#39;的声明 - cvc-elt.1: Cannot find the declaration of element 'NewIssue' 使用cvc-elt.1进行xsd验证失败:无法找到元素的声明 - xsd validation fails with cvc-elt.1: Cannot find the declaration of element XML,XSD,cvc-elt.1:找不到元素的声明 - XML, XSD, cvc-elt.1: Cannot find the declaration of element
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM