解决方案 »

  1.   

    说是类,你写为private类型的了。改为public
      

  2.   

    List<Person> findByBirthdayGreaterThan(Date date)
    修改成
    List<Person> findByBirthdayGreaterThan(Date birthday) 试试
      

  3.   

    http://bbs.csdn.net/topics/380226460
    看下这个吧。貌似是一个问题。
      

  4.   

    jpa dao接口方法命名需要符合一定的规范,看看官方文档
      

  5.   

    改了,改成最简单的“List<Person> findByName(String name);”没用
    是不是配置文件<?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:aop="http://www.springframework.org/schema/aop"  
        xmlns:tx="http://www.springframework.org/schema/tx"  
        xmlns:p="http://www.springframework.org/schema/p"  
        xmlns:cache="http://www.springframework.org/schema/cache"  
        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-3.1.xsd   
              http://www.springframework.org/schema/context   
              http://www.springframework.org/schema/context/spring-context-3.1.xsd   
              http://www.springframework.org/schema/aop   
              http://www.springframework.org/schema/aop/spring-aop-3.1.xsd   
              http://www.springframework.org/schema/tx    
              http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
              http://www.springframework.org/schema/cache 
              http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
              http://www.springframework.org/schema/data/jpa
              http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">  
            
            <context:annotation-config />  
            
            <context:component-scan base-package="cn.luxh.app"/> 
           
            <!-- 定义实体管理器工厂 -->
            <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">  
                 <property name="persistenceUnitName" value="simple"/>
            </bean>
             
             <!-- 配置事务管理器 -->  
               <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">  
                <property name="entityManagerFactory" ref="entityManagerFactory" />  
               </bean> 
           
              <!-- 启用 annotation事务--> 
               <tx:annotation-driven transaction-manager="transactionManager"/> 
               
               <!-- 配置Spring Data JPA扫描目录--> 
               <jpa:repositories base-package="cn.luxh.app.repository"/>
                   
           
    </beans>
      

  6.   

    <jpa:repositories base-package="cn.luxh.app.repository"/>
    ->
    <jpa:repositories base-package="cn.luxh.app.repository"
    transaction-manager-ref="transactionManager"
    entity-manager-factory-ref="entityManagerFactory" />
    在试试
      

  7.   

    使用spring data JPA没有遇到这样的错误。不知为何。不过看楼主使用的版本跟我不一样就是。
      

  8.   

    我也参考了http://www.cnblogs.com/luxh/archive/2012/08/31/2665421.html,问题和楼主的一样,不能再Dao层自定义方法(已经按Jpa规范定义了,甚至@query也用过),定义就报错,请问楼主最后是如何解决的?