Spring Data JPA
  1. Spring Data JPA
  2. DATAJPA-160

Spring Data- JPA Schema validation error in STS

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.0.3, 1.1 RC1
    • Component/s: Namespace
    • Labels:
      None
    • Environment:
      STS Version: 2.8.1.RELEASE Build Id: 201111221000
      Spring-Data-JPA 1.0.2-RELEASE

      Description

      I have included a forum link here http://forum.springsource.org/showthread.php?118643-xsd-validation-errors-in-Eclipse-when-using-spring-data by someone else apparently having the same issue as I am. My configuration is even simpler than the one described in the forum thread I have posted it in its entirety below:

      <?xml version="1.0" encoding="UTF-8"?>
      <beans:beans xmlns= "http://www.springframework.org/schema/data/jpa" 
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:beans="http://www.springframework.org/schema/beans"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd">
      		
      	<repositories base-package="com.xxxx.xxxx.store.repository" entity-manager-factory-ref="localContainerEntityManagerFactoryBean">
      	</repositories>
      </beans:beans>
      

      Basically STS is showing the annoying red X saying that 'A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://www.springframework.org/schema/

      {context, beans tool}

      ,xxx' Where xxx can be replaced by one of the many components within the namespace.

      I am using Java Config and importing that XML with @ImportResource from my java configuration file. Since I noticed a post was just made on how to configure spring data JPA with java configuration I will try that as a work around. I have classified this as a minor bug as things seem to still work normally but I am trying to introduce Spring data into one of my enterprise projects and a big red X does not instill a lot of faith

      Thanks,

        Issue Links

          Activity

          Hide
          Oliver Gierke added a comment -

          Removed the version references in the XSD file.

          Show
          Oliver Gierke added a comment - Removed the version references in the XSD file.
          Hide
          William Gorder added a comment -

          Oliver,

          Is there a way for me to get this fix before 1.0.3 is officially released? (I am not sure how soon that is happening). If so what would I have to include in my POM?

          Show
          William Gorder added a comment - Oliver, Is there a way for me to get this fix before 1.0.3 is officially released? (I am not sure how soon that is happening). If so what would I have to include in my POM?
          Hide
          Hendrik Leppkes added a comment -

          I'm still getting a XML validation error in STS 3.1 (Eclipse 3.8), with Spring-Data JPA 1.2 or1.3, and Spring 3.1 or 3.2. With Spring 3.0 its fine.

          sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://www.springframework.org/schema/tool,annotation'.

          There is a forum thread with more details here:
          http://forum.springsource.org/showthread.php?122577-XML-Validation-Problems-A-schema-cannot-contain-two-global-components-with-the-same

          Some people seem to have found some odd workaround, but none of them work for me.
          The thread started with the original issue mentioned here (the hardcoded version reference), however it seems it was not resolved completely for some of us.

          Show
          Hendrik Leppkes added a comment - I'm still getting a XML validation error in STS 3.1 (Eclipse 3.8), with Spring-Data JPA 1.2 or1.3, and Spring 3.1 or 3.2. With Spring 3.0 its fine. sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://www.springframework.org/schema/tool,annotation'. There is a forum thread with more details here: http://forum.springsource.org/showthread.php?122577-XML-Validation-Problems-A-schema-cannot-contain-two-global-components-with-the-same Some people seem to have found some odd workaround, but none of them work for me. The thread started with the original issue mentioned here (the hardcoded version reference), however it seems it was not resolved completely for some of us.
          Hide
          Oliver Gierke added a comment - - edited

          Please do not re-open tickets marked as resolved against an already released version. Please create a new ticket to solve further issues. We can link this one as related then.

          Show
          Oliver Gierke added a comment - - edited Please do not re-open tickets marked as resolved against an already released version. Please create a new ticket to solve further issues. We can link this one as related then.

            People

            • Assignee:
              Oliver Gierke
              Reporter:
              William Gorder
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: