Announcement Announcement Module
Collapse
No announcement yet.
Default version of spring context xml schema Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default version of spring context xml schema

    Hello.

    I usually specify schema location in my configuration files like this:

    Code:
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
            "
    But when I switched to integration 2.2.0 (from 2.1.3) and used some new features, my IDE found errors int the xml file.
    I thought that spring-integration.xsd refers to the latest schema, but it differs from versions 2.0, 2.1 and 2.2. Specifying spring-integration-2.2.xsd solves the validation problems, but makes migration to a newer version more complicated.

    For example http://www.springframework.org/schem...ring-beans.xsd refers to the same schema as http://www.springframework.org/schem...-beans-3.2.xsd

    What is the best practice to configure namespaces for integration?

    Thanks,
    -- Alexey

  • #2
    Hi!

    Take a look here: http://forum.springsource.org/showthread.php?126494

    Take care,
    Artem

    Comment


    • #3
      I've already tried it. The URL http://www.springframework.org/schem...ntegration.xsd refers to a 1.0 schema version.
      It's interesting that http://www.springframework.org/schem...gration-ip.xsd referes to 2.0 (at least it imports core schema 2.0).

      I think URLs without versions should refer schemes of the same version (probably the latest and the greatest)

      Comment


      • #4
        Yes; for historical reasons, the version-less schema on the internet is 1.0 - this is to avoid applications that use versions earlier than 1.0.3 from having problems. We were talking about this last week and maybe now it's time to risk breaking those applications for the benefit of avoiding these kinds of issues.

        However, I am surprised that clearing the cache and rebuilding did not resolve your issues; it always does for me (and most others).

        Apparently, some more work has been done in STS in this area and will be released soon.

        Comment


        • #5
          I'm using STS based on eclipse 3.8, but not 4.*.
          After clearing the cache I can ctrl+click to that URL in my context file and 1.0 schema is opened. I do not understand why STS should validate my context with the newer schema.

          Comment


          • #6
            I am using the same thing (3.1.0 w/ eclipse 3.8).

            Of course, control-click will open the URL on the internet - but STS doesn't use that for Spring projects (with Spring Project Nature enabled), it uses metadata in the Spring Jars (META-INF/schemas) to map URLs to the physical file in the jar; for example

            http\://www.springframework.org/schema/integration/spring-integration.xsd=org/springframework/integration/config/xml/spring-integration-2.2.xsd

            Don't ctrl-click - that might simply put the wrong schema in the cache.

            You can also try disabling the cache altogether.

            Comment

            Working...
            X