Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: XML Validation Problems - A schema cannot contain two global components with the same

  1. #11
    Join Date
    Nov 2012
    Posts
    1

    Default

    Thanks, this fixed my problem

  2. #12
    Join Date
    Dec 2012
    Posts
    5

    Default

    Quote Originally Posted by lucas1223 View Post
    weird, I started having a problem like this when I installed cloud foundry plugin for eclipse, tried your solution, it did not solve my problem.


    the file applicationContext.jpa is acusing these errors:





    the application works, its just a pain in the ass the compilation error, it was right after I installed the cloud foundry plugin =/
    I have solved it by doing 3 things:

    1. Added this repository to my POM:
    <repository>
    <id>spring-milestone</id>
    <name>Spring Maven MILESTONE Repository</name>
    <url>http://repo.springsource.org/libs-milestone</url>
    </repository>


    2. I'm using this version of spring-jpa:
    <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
    <version>1.2.0.RELEASE</version>
    </dependency>


    3. I removed the xsd versions from my context (although I'm not sure it is necessary):
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schem...ng-context.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
    http://www.springframework.org/schema/data/jpa http://www.springframework.org/schem...spring-jpa.xsd
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">



    I hope this helps.
    Last edited by forhas; Dec 6th, 2012 at 02:29 AM.

  3. #13
    Join Date
    Feb 2013
    Posts
    1

    Default

    I'm still getting this error with Spring 3.1.4 and Spring Data JPA 1.2.0 and 1.3.0.
    Using Spring 3.0.7 is obviously fine.

    None of the mentioned tips has helped to resolve this issue so far, its really quite annoying.

  4. #14

    Default

    This happens on Framework 3.2.1.RELEASE when using Spring Data JPA 1.2.0.RELEASE and 1.3.0.RELEASE as well. Generic or versioned XSD references seem to make no difference. I also tried reorganizing my POM to ensure that transient dependencies were resolved at the correct version with no luck. This is rather annoying...

  5. #15

    Default

    Quote Originally Posted by michael_lashinsky View Post
    This happens on Framework 3.2.1.RELEASE when using Spring Data JPA 1.2.0.RELEASE and 1.3.0.RELEASE as well. Generic or versioned XSD references seem to make no difference. I also tried reorganizing my POM to ensure that transient dependencies were resolved at the correct version with no luck. This is rather annoying...
    Of course this just made me a liar... I had versioned schema locations, made them generic, reordered my POM and made the assumption that versionless should work regardless. Went back versioned my schemas and the error was resolved.

    my spring config header:
    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:p="http://www.springframework.org/schema/p" 
           	xmlns:tx="http://www.springframework.org/schema/tx"
           	xmlns:context="http://www.springframework.org/schema/context"
           	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
           	xmlns:jpa="http://www.springframework.org/schema/data/jpa"
           	xmlns:util="http://www.springframework.org/schema/util"
           	xsi:schemaLocation="
    			http://www.springframework.org/schema/beans 
    			http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    			http://www.springframework.org/schema/tx 
    			http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
    			http://www.springframework.org/schema/context
    			http://www.springframework.org/schema/context/spring-context-3.2.xsd
    			http://www.springframework.org/schema/jdbc 
    			http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
    			http://www.springframework.org/schema/data/jpa
       			http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
    			http://www.springframework.org/schema/util 
    			http://www.springframework.org/schema/util/spring-util-3.2.xsd">
    my pom.xml
    Code:
         ...
        <!-- Spring Web MVC -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-webmvc</artifactId>
          <version>3.2.1.RELEASE</version>
          <exclusions>
            <exclusion>
              <groupId>commons-logging</groupId>
              <artifactId>commons-logging</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
         ...
        <!-- Spring JPA -->
        <dependency>
          <groupId>org.springframework.data</groupId>
          <artifactId>spring-data-jpa</artifactId>
          <version>1.3.0.RELEASE</version>
        </dependency>
        ...
    The reason this works makes no sense to me, but it does so I am semi-happy. Hope someone else finds this useful.

  6. #16
    Join Date
    Nov 2007
    Posts
    11

    Default

    I have same problem in eclipse.

    Here is my spring configuration
    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:jpa="http://www.springframework.org/schema/data/jpa"
    	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.xsd">
    
    	<jpa:repositories base-package="my.package" />
    
    </beans>
    And these are the maven dependencies:

    Code:
    	<dependencies>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-web</artifactId>
    			<version>3.2.2.RELEASE</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-orm</artifactId>
    			<version>3.2.2.RELEASE</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-context-support</artifactId>
    			<version>3.2.2.RELEASE</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-jpa</artifactId>
    			<version>1.3.0.RELEASE</version>
    		</dependency>
    	</dependencies>
    None of the previous solutions works.
    Can anyone replicate this issue? No code needed.. just the application context file.
    Thank you for your feedback.

  7. #17

    Default

    I have the same error,
    Did you find solution ?

  8. #18
    Join Date
    Nov 2007
    Posts
    11

    Default

    Quote Originally Posted by ilia.prizker View Post
    I have the same error,
    Did you find solution ?
    No solution yet

  9. #19

    Default

    I find solution for this issue:
    my pom.xml

    <spring.version>3.2.1.RELEASE</spring.version>
    <spring.data.jpa.version>1.3.0.RELEASE</spring.data.jpa.version>

    Code:
    <repository>
        <id>spring-milestone</id>
        <name>Spring Maven MILESTONE Repository</name>
        <url>http://repo.springsource.org/libs-milestone</url>
    </repository>
    in my spring-data-jpa.xml
    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:p="http://www.springframework.org/schema/p"
           	xmlns:tx="http://www.springframework.org/schema/tx"
           	xmlns:context="http://www.springframework.org/schema/context"
           	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
      		xmlns:jpa="http://www.springframework.org/schema/data/jpa"
           	xsi:schemaLocation="
    		http://www.springframework.org/schema/beans
    		http://www.springframework.org/schem...ring-beans.xsd
    		http://www.springframework.org/schema/tx
    		http://www.springframework.org/schema/tx/spring-tx.xsd
    		http://www.springframework.org/schema/context
    		http://www.springframework.org/schem...ng-context.xsd
    		http://www.springframework.org/schema/jdbc
    		http://www.springframework.org/schem...pring-jdbc.xsd
        		http://www.springframework.org/schema/data/jpa
       		http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd">
    hope it's work for you !

  10. #20
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    I've had this very problems twice or three times in my current project, that it's a roo multi module year old project. Some projects depend on others, sometimes transitively.

    During this time, I've updated the Spring dependencies whenever I can (that is, almost always)

    But, not all the modules have been updated at the same time, so at the end I've had a mess with the Spring dependencies.

    Once all the modules have the same Spring dependencies, the XML validation problem dissapears.

    I hope it helps.

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
  •