Results 1 to 6 of 6

Thread: Default version of spring context xml schema

  1. #1
    Join Date
    Nov 2010
    Location
    St-Petersburg, Russia
    Posts
    33

    Question 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. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    646

    Default

    Hi!

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

    Take care,
    Artem

  3. #3
    Join Date
    Nov 2010
    Location
    St-Petersburg, Russia
    Posts
    33

    Default

    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)

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,040

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Nov 2010
    Location
    St-Petersburg, Russia
    Posts
    33

    Default

    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.

  6. #6
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,040

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •