Announcement Announcement Module
Collapse
No announcement yet.
Spring IDE problems with xml validation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring IDE problems with xml validation

    I'm getting validation errors on my spring config file

    Code:
    cvc-complex-type.3.2.2: Attribute 'default-dependency-check' is not allowed to appear in element 'beans'.	applicationContext.xml	Batch-server/src/META-INF	line 13	Spring Beans Problem
    cvc-complex-type.3.2.2: Attribute 'dependency-check' is not allowed to appear in element 'bean'.	applicationContext.xml	Batch-server/src/META-INF	line 45	Spring Beans Problem
    cvc-complex-type.3.2.2: Attribute 'dependency-check' is not allowed to appear in element 'bean'.	applicationContext.xml	Batch-server/src/META-INF	line 52	Spring Beans Problem
    cvc-complex-type.3.2.2: Attribute 'dependency-check' is not allowed to appear in element 'bean'.	applicationContext.xml	Batch-server/src/META-INF	line 59	Spring Beans Problem
    The top of the config file looks like this:
    Code:
    <?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:util="http://www.springframework.org/schema/util"
    	xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:lang="http://www.springframework.org/schema/lang"
    	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/util http://www.springframework.org/schema/util/spring-util.xsd
               http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
               http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"
    	default-dependency-check="objects">
    This is using Spring IDE 2.2.4.

    I tried downloading the latest 2.2.6, but I'm getting these errors:
    An error occurred while collecting items to be installed
    No repository found containing: com.springsource.org.aspectj.runtime/osgi.bundle/1.6.3.RELEASE
    No repository found containing: com.springsource.org.aspectj.weaver/osgi.bundle/1.6.3.RELEASE
    No repository found containing: org.springframework.context.support/osgi.bundle/3.0.0.SNAPSHOT
    No repository found containing: org.springframework.ide.eclipse/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.beans.core/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.beans.ui/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.beans.ui.editor/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.beans.ui.graph/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.beans.ui.refactori ng/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.beans.ui.search/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.core/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.doc/osgi.bundle/2.2.5.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.feature/org.eclipse.update.feature/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.ide.eclipse.ui/osgi.bundle/2.2.6.200908051215-RELEASE
    No repository found containing: org.springframework.jms/osgi.bundle/3.0.0.SNAPSHOT
    No repository found containing: com.springsource.javax.xml.stream/osgi.bundle/1.0.1
    No repository found containing: com.springsource.org.antlr/osgi.bundle/3.0.1
    No repository found containing: org.springframework.osgi.core/osgi.bundle/2.0.0.M1
    No repository found containing: org.springframework.osgi.io/osgi.bundle/2.0.0.M1

  • #2
    I successfully upgraded to IDE 2.2.6 using this URL: http://www.springsource.com/update/e3.4.

    But I still have the same validation errors. I tried manually setting the schema versions via the IDE, but this didn't fix the problem.

    The only bean configs that work are those that specify a specific xsd version, i.e.,
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <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-2.5.xsd"
    	default-dependency-check="none">

    Comment


    • #3
      Hey,

      the dependency-check and default-dependency-check elements have been removed in Spring 3.0 hence your validation errors.

      Please see https://fisheye.springsource.org/bro...r2=1003&r1=172

      Spring IDE ships the Spring 3.0 XSDs and maps the version-less schemalocation to the 3.0 XSDs which is causing the validation of your XML files to fail. I recommend you specify the concrete version as otherwise your XML files will not work when upgrading to Spring 3.0.

      HTH

      Christian

      Comment


      • #4
        Originally posted by Christian Dupuis View Post
        Hey,

        the dependency-check and default-dependency-check elements have been removed in Spring 3.0 hence your validation errors.

        Please see https://fisheye.springsource.org/bro...r2=1003&r1=172

        Spring IDE ships the Spring 3.0 XSDs and maps the version-less schemalocation to the 3.0 XSDs which is causing the validation of your XML files to fail. I recommend you specify the concrete version as otherwise your XML files will not work when upgrading to Spring 3.0.

        HTH

        Christian
        I'm sorry to hear that. It seems to run contrary to the "backward compatibility" we've come to expect from new Spring releases. Did I miss a warning in 2.5 that this would be removed?

        Comment


        • #5
          I just came across this post and thought I should clarify this.

          Originally posted by easternwahoo View Post
          I'm sorry to hear that. It seems to run contrary to the "backward compatibility" we've come to expect from new Spring releases. Did I miss a warning in 2.5 that this would be removed?
          No, you didn't miss a warning. Deprecation of xsd features is not as convenient as it is for Java code. The removal of the "default-dependency-check" in the 3.0 xsd IS the "deprecation". You can still use the 2.5 xsd by specifying the version and it will all work since the attribute is still supported in the 3.0 code, just not present in 3.0 xsd anymore.

          You're better off always specifying the version for the xsd you are using.

          Comment


          • #6
            What should be used instead of default-dependency-check and dependency-check ?
            The current documentation:
            http://static.springsource.org/sprin...y-dependencies
            uses the following (quote):
            "In XML-based configuration metadata, you specify dependency checking via the dependency-check attribute in a bean definition, which can have the following values."
            Last edited by stole; Jan 5th, 2010, 08:55 AM. Reason: supplementary information

            Comment


            • #7
              BTW, major (first-digit change) releases typically does not guarantee 100% backward compatibility, here is more or less standard convention for release numbering (established by Apache Portable Runtime and followed by many projects around the world)
              Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.
              Originally posted by easternwahoo View Post
              I'm sorry to hear that. It seems to run contrary to the "backward compatibility" we've come to expect from new Spring releases. Did I miss a warning in 2.5 that this would be removed?

              Comment


              • #8
                Originally posted by stole View Post
                What should be used instead of default-dependency-check and dependency-check ?
                The current documentation:
                http://static.springsource.org/sprin...y-dependencies
                uses the following (quote):
                "In XML-based configuration metadata, you specify dependency checking via the dependency-check attribute in a bean definition, which can have the following values."
                The @Required annotation should be used instead.

                Comment


                • #9
                  Originally posted by easternwahoo View Post
                  The @Required annotation should be used instead.
                  Especially with the 3rd-party code

                  Comment


                  • #10
                    I was wondering if the @Required annotation can be used together with constructor injection? Also what about the documentation:
                    http://static.springsource.org/sprin...y-dependencies
                    Is this an error in the documentation (quote): In XML-based configuration metadata, you specify dependency checking via the dependency-check attribute in a bean definition, which can have the following values...

                    Comment


                    • #11
                      Originally posted by easternwahoo View Post
                      The @Required annotation should be used instead.
                      Yes and also dont forget to add RequiredAnnotationBeanPostProcessor to your beans.xml (or whatever you use)

                      <bean class="org.springframework.beans.factory.annotatio n.RequiredAnnotationBeanPostProcessor"/>

                      Comment

                      Working...
                      X