Spring Framework
  1. Spring Framework
  2. SPR-6103

The matching wildcard is strict, but no declaration can be found for element 'context:spring-configured'.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 3.0 M4
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      Having problem finding xsd spring-context-3.0.xsd. See the spring forum reference for more info.

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

      <context:spring-configured/>

      <context:annotation-config/>

      <context:component-scan base-package="com.xyz" use-default-filters="false">
      <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
      </context:component-scan>

      </beans>

      Here's the error:

      2009-09-13 02:01:54,308 TRACE PluggableSchemaResolver.resolveEntity():105 - Trying to resolve XML entity with public id [null] and system id http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      2009-09-13 02:01:54,310 DEBUG PluggableSchemaResolver.getSchemaMappings():132 - Loading schema mappings from [META-INF/spring.schemas]
      2009-09-13 02:01:54,312 DEBUG PluggableSchemaResolver.getSchemaMappings():138 - Loaded schema mappings:

      Unknown macro: {http}

      2009-09-13 02:01:54,324 DEBUG PluggableSchemaResolver.resolveEntity():116 - Found XML schema http://www.springframework.org/schema/beans/spring-beans-3.0.xsd in classpath: org/springframework/beans/factory/xml/spring-beans-3.0.xsd
      2009-09-13 02:01:54,467 TRACE PluggableSchemaResolver.resolveEntity():105 - Trying to resolve XML entity with public id [null] and system id http://www.springframework.org/schema/beans/spring-context-3.0.xsd
      2009-09-13 02:01:56,563 TRACE BeansDtdResolver.resolveEntity():55 - Trying to resolve XML entity with public ID [-//W3C//DTD XHTML 1.0 Strict//EN] and system ID http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
      2009-09-13 02:01:56,647 WARN SimpleSaxErrorHandler.warning():47 - Ignored XML validation warning
      org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-context-3.0.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>.
      ........
      org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 20 in XML document from file [/Users/crash/svn/xyz/xyz-web/target/xyz-web-0.1.0-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml] is invalid; 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 'context:spring-configured'.
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:378)

        Activity

        Hide
        Bjorn Harvold added a comment -

        I have tried with and without versions for the XSDs without any luck.

        Show
        Bjorn Harvold added a comment - I have tried with and without versions for the XSDs without any luck.
        Hide
        Bjorn Harvold added a comment -

        When I use exactly this setup it works:

        <beans xmlns="http://www.springframework.org/schema/beans"
        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:tx="http://www.springframework.org/schema/tx"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://www.springframework.org/schema/jee
        http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

        I have no idea what's going on.

        Show
        Bjorn Harvold added a comment - When I use exactly this setup it works: <beans xmlns="http://www.springframework.org/schema/beans" 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:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd "> I have no idea what's going on.
        Hide
        Juergen Hoeller added a comment -

        It seems you simply got the XSD URL wrong: It's "http://www.springframework.org/schema/context/spring-context-3.0.xsd" - not "schema/beans/" but "schema/context/"...

        Juergen

        Show
        Juergen Hoeller added a comment - It seems you simply got the XSD URL wrong: It's "http://www.springframework.org/schema/context/spring-context-3.0.xsd" - not "schema/beans/" but "schema/context/"... Juergen
        Hide
        Bjorn Harvold added a comment -

        Thanks Juergen

        Love it when it's that easy.

        Show
        Bjorn Harvold added a comment - Thanks Juergen Love it when it's that easy.

          People

          • Assignee:
            Juergen Hoeller
            Reporter:
            Bjorn Harvold
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 32 weeks, 2 days ago