
Originally Posted by
dr_pompeii
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&nf=1&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