Announcement Announcement Module
Collapse
No announcement yet.
Cannot resolve the name 'repository:repository' Exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot resolve the name 'repository:repository' Exception

    Hi I have the following Spring startup script:

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:mongo="http://www.springframework.org/schema/data/mongo"
    	xmlns:task="http://www.springframework.org/schema/task"
    	xsi:schemaLocation="http://www.springframework.org/schema/jdbc 
    		http://www.springframework.org/schema/jdbc/spring-jdbc.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/schema/data/jpa/spring-jpa.xsd
        	http://www.springframework.org/schema/context 
        	http://www.springframework.org/schema/context/spring-context.xsd
    		http://www.springframework.org/schema/beans 
    		http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/task 
    		http://www.springframework.org/schema/task/spring-task.xsd
    		http://www.springframework.org/schema/data/mongo
        	http://www.springframework.org/schema/data/mongo/spring-mongo.xsd">
    I have the following spring data modules:

    Code:
    		<dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-jpa</artifactId>
    			<version>1.1.0.RELEASE</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-mongodb</artifactId>
    			<version>1.1.0.RC1</version>
    		</dependency>
    		<dependency>
    			 <groupId>org.springframework.data</groupId>
    			 <artifactId>spring-data-commons-core</artifactId>
    			 <version>1.4.0.BUILD-SNAPSHOT</version>
    		</dependency>
    I get the following exception:

    Code:
    Caused by: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:repository' to a(n) 'type definition' component.
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2537)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getGlobalDecl(XSDHandler.java:1472)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexContent(XSDComplexTypeTraverser.java:706)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl(XSDComplexTypeTraverser.java:260)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseGlobal(XSDComplexTypeTraverser.java:160)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas(XSDHandler.java:1255)
    	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:579)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:556)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2443)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1788)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:731)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
    	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
    	... 36 more
    Any thoughts?

    I've tried adding version numbers to the schema definitions, but nothing seems to work.

    Thanks,
    Tom

  • #2
    Hello

    I've tried adding version numbers to the schema definitions, but nothing seems to work.
    Keep or use the last versions for each one. Do that again

    Code:
    Caused by: org.xml.sax.SAXParseException: src-resolve: 
    Cannot resolve the name 'repository:repository' to a(n) 'type definition' component.
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    Could you post your pom.xml code? seems the error is located there

    About

    Code:
    <dependency>
    	<groupId>org.springframework.data</groupId>
    	<artifactId>spring-data-jpa</artifactId>
    	<version>1.1.0.RELEASE</version>
    </dependency>
    <dependency>
    	<groupId>org.springframework.data</groupId>
    	<artifactId>spring-data-mongodb</artifactId>
    	<version>1.1.0.RC1</version>
    </dependency>
    <dependency>
    	 <groupId>org.springframework.data</groupId>
    	 <artifactId>spring-data-commons-core</artifactId>
    	 <version>1.4.0.BUILD-SNAPSHOT</version>
    </dependency>
    Be totally sure the versions are corrects and you using all the dependencies need it

    Comment


    • #3
      Full Pom.xml

      Originally posted by dr_pompeii View Post
      Could you post your pom.xml code? seems the error is located there
      Code:
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
      
        <groupId>com.presidioHealth</groupId>
        <artifactId>ppsDocumentLibrary</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <packaging>jar</packaging>
      
        <name>ppsDocumentLibrary</name>
        <url>http://maven.apache.org</url>
      
      
      	<properties>
      		<java-version>1.6</java-version>
      
      		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      		<maven.test.failure.ignore>true</maven.test.failure.ignore>
      		<mongo-java-driver.version>2.7.2</mongo-java-driver.version>
      		<org.apache.commons-dbcp.version>1.2.2</org.apache.commons-dbcp.version>
      		<org.eclipselink-version>2.4.0</org.eclipselink-version>
      		<org.springframework.data.version>1.1.0.RELEASE</org.springframework.data.version>
      		<org.springframework.data.mongo.version>1.1.0.RC1</org.springframework.data.mongo.version>
      		<org.springframework-version>3.1.2.RELEASE</org.springframework-version>
      		<org.springsecurity-version>3.1.1.RELEASE</org.springsecurity-version>
      		<org.aspectj-version>1.7.0</org.aspectj-version>
      		<org.slf4j-version>1.5.10</org.slf4j-version>
      
      	</properties>
      	<build>
      		<plugins>
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-compiler-plugin</artifactId>
      				<configuration>
      					<source>1.6</source>
      					<target>1.6</target>
      				</configuration>
      			</plugin>
      			<plugin>
      				<groupId>org.zeroturnaround</groupId>
      				<artifactId>jrebel-maven-plugin</artifactId>
      				<version>1.1.1</version>
      				<executions>
      					<execution>
      						<id>generate-rebel-xml</id>
      						<phase>process-resources</phase>
      						<goals>
      							<goal>generate</goal>
      						</goals>
      					</execution>
      				</executions>
      			</plugin>
      		</plugins>
      	</build>
      
      	<repositories>
      		<repository>
      			<id>EclipseLink Repo</id>
      			<!-- note that ampersands in this URL are escaped because this is in an 
      				xml file - un-escape them to use in browser -->
      			<url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
      			<!-- use this for javax.persistence <snapshots> <enabled>true</enabled> 
      				</snapshots> -->
      		</repository>
      		<repository>
      			<id>spring-milestone</id>
      			<name>Spring Maven MILESTONE Repository</name>
      			<url>http://repo.springsource.org/libs-milestone</url>
      		</repository>
      		<repository>
      			<id>spring-snapshot</id>
      			<name>Spring Maven MILESTONE Repository</name>
      			<url>http://repo.springsource.org/libs-snapshot</url>
      		</repository>
      	</repositories>
      
      	<dependencies>
      		<!-- Testing -->
      		<dependency>
      			<groupId>junit</groupId>
      			<artifactId>junit</artifactId>
      			<version>4.9</version>
      			<scope>test</scope>
      		</dependency>
      
      		<!-- Spring Framework -->
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-expression</artifactId>
      			<version>${org.springframework-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-test</artifactId>
      			<version>${org.springframework-version}</version>
      			<scope>test</scope>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-context-support</artifactId>
      			<version>${org.springframework-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-context</artifactId>
      			<version>${org.springframework-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-aop</artifactId>
      			<version>${org.springframework-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-orm</artifactId>
      			<version>${org.springframework-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-web</artifactId>
      			<version>${org.springframework-version}</version>
      		</dependency>
      
      		<!-- Spring Data -->
      		<dependency>
      			<groupId>org.springframework.data</groupId>
      			<artifactId>spring-data-jpa</artifactId>
      			<version>${org.springframework.data.version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.data</groupId>
      			<artifactId>spring-data-mongodb</artifactId>
      			<version>${org.springframework.data.mongo.version}</version>
      		</dependency>
      		<dependency>
      			 <groupId>org.springframework.data</groupId>
      			 <artifactId>spring-data-commons-core</artifactId>
      			 <version>1.4.0.BUILD-SNAPSHOT</version>
      		</dependency> 
      
      
      		<!-- Logging -->
      		<dependency>
      			<groupId>org.slf4j</groupId>
      			<artifactId>slf4j-api</artifactId>
      			<version>${org.slf4j-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.slf4j</groupId>
      			<artifactId>jcl-over-slf4j</artifactId>
      			<version>${org.slf4j-version}</version>
      			<scope>runtime</scope>
      		</dependency>
      		<dependency>
      			<groupId>org.slf4j</groupId>
      			<artifactId>slf4j-log4j12</artifactId>
      			<version>${org.slf4j-version}</version>
      			<scope>runtime</scope>
      		</dependency>
      		<dependency>
      			<groupId>log4j</groupId>
      			<artifactId>log4j</artifactId>
      			<version>1.2.15</version>
      			<exclusions>
      				<exclusion>
      					<groupId>javax.mail</groupId>
      					<artifactId>mail</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>javax.jms</groupId>
      					<artifactId>jms</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>com.sun.jdmk</groupId>
      					<artifactId>jmxtools</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>com.sun.jmx</groupId>
      					<artifactId>jmxri</artifactId>
      				</exclusion>
      			</exclusions>
      			<scope>runtime</scope>
      		</dependency>
      
      		<!-- EclipseLink -->
      		<dependency>
      			<groupId>org.eclipse.persistence</groupId>
      			<artifactId>eclipselink</artifactId>
      			<version>${org.eclipselink-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.eclipse.persistence</groupId>
      			<artifactId>org.eclipse.persistence.jpa</artifactId>
      			<version>${org.eclipselink-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.eclipse.persistence</groupId>
      			<artifactId>org.eclipse.persistence.jpa.modelgen</artifactId>
      			<version>${org.eclipselink-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.eclipse.persistence</groupId>
      			<artifactId>org.eclipse.persistence.oracle</artifactId>
      			<version>${org.eclipselink-version}</version>
      		</dependency>
      		<dependency>
      			<groupId>org.eclipse.persistence</groupId>
      			<artifactId>javax.persistence</artifactId>
      			<version>2.0.0</version>
      		</dependency>
      
      		<!-- Data Provider -->
      		<dependency>
      			<groupId>com.jolbox</groupId>
      			<artifactId>bonecp</artifactId>
      			<version>0.7.1.RELEASE</version>
      		</dependency>
      		<dependency>
      			<groupId>commons-dbcp</groupId>
      			<artifactId>commons-dbcp</artifactId>
      			<version>${org.apache.commons-dbcp.version}</version>
      		</dependency>
      
      		<!-- MongoDB Driver -->
      		<dependency>
      			<groupId>org.mongodb</groupId>
      			<artifactId>mongo-java-driver</artifactId>
      			<version>${mongo-java-driver.version}</version>
      		</dependency>
      
      		<!-- Miscellaneous -->
      		<dependency>
      			<groupId>commons-collections</groupId>
      			<artifactId>commons-collections</artifactId>
      			<version>3.2.1</version>
      		</dependency>
      		<dependency>
      			<groupId>cglib</groupId>
      			<artifactId>cglib</artifactId>
      			<version>2.2.2</version>
      		</dependency>
      		<dependency>
      			<groupId>org.projectlombok</groupId>
      			<artifactId>lombok</artifactId>
      			<version>0.10.8</version>
      			<scope>provided</scope>
      		</dependency>
      
      		<!-- MYSQL -->
      		<dependency>
      			<groupId>mysql</groupId>
      			<artifactId>mysql-connector-java</artifactId>
      			<version>5.1.20</version>
      		</dependency>
      	</dependencies>
      </project>
      I'll go to the previous versions for all. I've tried it and getting errors with classes not found.

      Tom

      Comment


      • #4
        Hello Tom

        Code:
        Caused by: org.xml.sax.SAXParseException: src-resolve: 
        Cannot resolve the name 'repository:repository' to a(n) 'type definition' component.
        	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        The red URL is broken

        Code:
        <repositories>
        	<repository>
        		<id>EclipseLink Repo</id>
        		<!-- note that ampersands in this URL are escaped because this is in an 
        			xml file - un-escape them to use in browser -->
        		<url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
        		<!-- use this for javax.persistence <snapshots> <enabled>true</enabled> 
        			</snapshots> -->
        	</repository>
        	<repository>
        		<id>spring-milestone</id>
        		<name>Spring Maven MILESTONE Repository</name>
        		<url>http://repo.springsource.org/libs-milestone</url>
        	</repository>
        	<repository>
        		<id>spring-snapshot</id>
        		<name>Spring Maven MILESTONE Repository</name>
        		<url>http://repo.springsource.org/libs-snapshot</url>
        	</repository>
        </repositories>

        Comment


        • #5
          Updated - Still not working

          Originally posted by dr_pompeii View Post
          Code:
          <repositories>
          	<repository>
          		<id>EclipseLink Repo</id>
          		<!-- note that ampersands in this URL are escaped because this is in an 
          			xml file - un-escape them to use in browser -->
          		<url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
          		<!-- use this for javax.persistence <snapshots> <enabled>true</enabled> 
          			</snapshots> -->
          	</repository>
          	<repository>
          		<id>spring-milestone</id>
          		<name>Spring Maven MILESTONE Repository</name>
          		<url>http://repo.springsource.org/libs-milestone</url>
          	</repository>
          	<repository>
          		<id>spring-snapshot</id>
          		<name>Spring Maven MILESTONE Repository</name>
          		<url>http://repo.springsource.org/libs-snapshot</url>
          	</repository>
          </repositories>
          I've changed it to:

          Code:
          		<repository>
             			<id>EclipseLink</id>
             				<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
          		</repository>
          Same problem. No change.

          I've also tried going back to previous releases :

          Code:
          		<dependency>
          			<groupId>org.springframework.data</groupId>
          			<artifactId>spring-data-jpa</artifactId>
          			<version>1.0.2.RELEASE</version>
          		</dependency>
          		<dependency>
          			<groupId>org.springframework.data</groupId>
          			<artifactId>spring-data-mongodb</artifactId>
          			<version>1.0.2.RELEASE</version>
          		</dependency>
          		<dependency>
          			 <groupId>org.springframework.data</groupId>
          			 <artifactId>spring-data-commons-core</artifactId>
          			 <version>1.2.1.RELEASE</version>
          		</dependency>
          The problem with repository:repository goes away, but then I get:

          Code:
          Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.presidioHealth.ppsDataLibrary.repository.presidio.DocumentRepository com.presidioHealth.ppsDataLibrary.coding.TestEncounterCodingSearch.docRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: org.springframework.data.repository.query.parser.Part.getProperty()Lorg/springframework/data/repository/query/parser/Property;
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
          	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
          	... 26 more
          Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: org.springframework.data.repository.query.parser.Part.getProperty()Lorg/springframework/data/repository/query/parser/Property;
          	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
          	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1442)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:876)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:818)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:735)
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
          	... 28 more
          Caused by: java.lang.NoSuchMethodError: org.springframework.data.repository.query.parser.Part.getProperty()Lorg/springframework/data/repository/query/parser/Property;
          	at org.springframework.data.jpa.repository.query.JpaQueryCreator.toPredicate(JpaQueryCreator.java:163)
          	at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:95)
          	at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:49)
          	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109)
          	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88)
          	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73)
          	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.<init>(PartTreeJpaQuery.java:102)
          	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:59)
          	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:92)
          	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:159)
          	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:71)
          	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:269)
          	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:142)
          	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114)
          	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38)
          	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
          	... 36 more
          My DocumentRepository bean looks like:

          Code:
          public interface DocumentRepository extends JpaRepository<Document, Long> {
          
          	public List<Document> findByLocationDocumentTypeAndEncounter(LocationDocumentType ldt, Encounter enc);
          }
          If I change it to:

          Code:
          public interface DocumentRepository extends JpaRepository<Document, Long> {
          
          	@Query("select d from Document d where d.locationDocumentType = ?1 and d.encounter = ?2")
          	public List<Document> findByLocationDocumentTypeAndEncounter(LocationDocumentType ldt, Encounter enc);
          }
          It works like this. BUT, I HAVE MANY REPOSITORIES THAT HAVE FIND METHODS WHERE I DON'T WANT TO HAVE TO CREATE A @QUERY STATEMENT.

          If I JUST have JPA, then it all works. If I have just MongoDB, it works. I cannot get the two working together. I can't find a combination of Spring Data jars that work together.

          Thanks for all your help so far.

          Tom

          Comment


          • #6
            Found the solution

            Originally posted by mrbahr2003 View Post
            I've changed it to:

            I've also tried going back to previous releases :

            Code:
            		<dependency>
            			<groupId>org.springframework.data</groupId>
            			<artifactId>spring-data-jpa</artifactId>
            			<version>1.0.2.RELEASE</version>
            		</dependency>
            		<dependency>
            			<groupId>org.springframework.data</groupId>
            			<artifactId>spring-data-mongodb</artifactId>
            			<version>1.0.2.RELEASE</version>
            		</dependency>
            		<dependency>
            			 <groupId>org.springframework.data</groupId>
            			 <artifactId>spring-data-commons-core</artifactId>
            			 <version>1.2.1.RELEASE</version>
            		</dependency>
            I've found the solution. The only version that share the same

            spring-data-commons-core

            are:

            Code:
            		<dependency>
            			<groupId>org.springframework.data</groupId>
            			<artifactId>spring-data-jpa</artifactId>
            			<version>1.2.0.RC1</version>
            		</dependency>
            		<dependency>
            			<groupId>org.springframework.data</groupId>
            			<artifactId>spring-data-mongodb</artifactId>
            			<version>1.1.0.RC1</version>
            		</dependency>
            Thanks,
            Tom

            Comment


            • #7
              Originally posted by mrbahr2003 View Post
              I've found the solution. The only version that share the same

              spring-data-commons-core

              are:

              Code:
              		<dependency>
              			<groupId>org.springframework.data</groupId>
              			<artifactId>spring-data-jpa</artifactId>
              			<version>1.2.0.RC1</version>
              		</dependency>
              		<dependency>
              			<groupId>org.springframework.data</groupId>
              			<artifactId>spring-data-mongodb</artifactId>
              			<version>1.1.0.RC1</version>
              		</dependency>
              Thanks,
              Tom

              Like the other solutions, this one did not work as well, I still experience this issue with the jpa xsd causing an error message in eclipse.
              I using spring-data-jpa 1.2.0.RELEASE and the rest of my spring jars are 3.1.3.RELEASE. Regarding spring-data-commons-core - I don't even have a dependency to this jar in my pom but I can see it in my m2 repository along with spring-data-commons-parent and both of version 1.4.0.RELEASE, I don't know why (maybe those are part of spring-data-jpa?).

              For the xst I use
              http://www.springframework.org/schema/data/jpa http://www.springframework.org/schem...ng-jpa-1.2.xsd

              So far with no success..
              Any new insights?
              Last edited by forhas; Dec 5th, 2012, 02:23 AM.

              Comment


              • #8
                got da same problem with da xsd file...

                I've changed my Spring data config (Spring Data 1.1 + Spring Data Commons 1.4) to Spring Data Commons 1.3.2 and everything works perfektly fine now...


                i42

                Comment


                • #9
                  Haven't figured out the underlying cause, but I got a solution.

                  I had the same problem with spring-data-mongodb, using next versions:
                  • spring-data-mongodb : 1.2.0.RELEASE
                  • spring-data-commons : 1.5.0.RELEASE (inherited from spring-data-mongodb)
                  • spring-data-commons-core : 1.4.0.RELEASE (overriding managed version 1.2.0.RELEASE, to fix a different issue)
                  The way I solved it:

                  Just add these guys to your schemaLocation attribute of the XMLSchemaInstance namespace (most likely xsi:schemaLocation) in your Spring config xml file:

                  For example, my Spring config xml 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:context="http://www.springframework.org/schema/context"
                      xmlns:mongo="http://www.springframework.org/schema/data/mongo"
                      xsi:schemaLocation="
                          http://www.springframework.org/schema/beans
                          http://www.springframework.org/schema/beans/spring-beans-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/data/mongo
                          http://www.springframework.org/schema/data/mongo/spring-mongo-1.2.xsd
                          http://www.springframework.org/schema/data/repository
                          http://www.springframework.org/schema/data/repository/spring-repository-1.5.xsd">
                  ...
                  </beans>
                  Hope that works for you.
                  Last edited by RussellRC; Apr 5th, 2013, 05:02 PM.

                  Comment

                  Working...
                  X