Results 1 to 6 of 6

Thread: spring-beans-3.2.xsd Where is it ?

  1. #1
    Join Date
    Mar 2012
    Posts
    10

    Question spring-beans-3.2.xsd Where is it ?

    I've seen a lot of examples which use

    http://www.springframework.org/schem...-beans-3.2.xsd

    as their namespace for beans. I can't access this location though so my question is : how to update to use the new directives ?

    Mike

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    I doubt that as Spring 3.2 isn't final yet so t here isn't an xsd for it (yet)...

    Also when you have the correct spring jars spring will load the xsd from jar files so if you use Spring 3.2 RC1 it will be loaded for you (still might be that IDE's give you some trouble).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2012
    Posts
    10

    Default

    Quote Originally Posted by Marten Deinum View Post
    I doubt that as Spring 3.2 isn't final yet so t here isn't an xsd for it (yet)...

    Also when you have the correct spring jars spring will load the xsd from jar files so if you use Spring 3.2 RC1 it will be loaded for you (still might be that IDE's give you some trouble).
    Ok, to clarify. You suggest that, provided I have the spring jars on the cp (I do), that I can use new 3.2 directives with the 3.1 schema set in the namespace ?

    Cheers,
    Mike.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    You suggest that, provided I have the spring jars on the cp (I do), that I can use new 3.2 directives with the 3.1 schema set in the namespace ?
    No... You can simply use the 3.2 xsd... (It is adviced to use the versionless xsd btw which should always point to the most recent version which is on your classpath).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Mar 2012
    Posts
    10

    Default

    Quote Originally Posted by Marten Deinum View Post
    No... You can simply use the 3.2 xsd... (It is adviced to use the versionless xsd btw which should always point to the most recent version which is on your classpath).
    Ah ok.

    So you suggest

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	 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.2.xsd">
    Should work, but

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	 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.xsd">
    Is preferred. Is there some configuration needed to make this work correctly in STS ? Starting with the first option will cause runtime errors

    Code:
    Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
    Sorry I dont mean to turn this into a debug session, so if you can point me to the relevant documentation in code that would also be fine.

    Cheers,
    Mike.

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    It depends on your STS version... The newest version should detect the xsd files in the jar files (if the correct tooling files are in the spring jar files that is). IN older versions you would need to add them to the catalog yourselves.

    If you get runtime errors there is something wrong with your deployment/build. Check the jars that get packaged with your application make sure that you don't mix spring versions. Also be aware that 3.2 isn't final it is still in development!
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

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