设置文件applicationContext.xml是这样的
<bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
    <property name="sessionFactory">
      <ref bean="sessionFactory"/>
    </property>
  </bean>
  
  <bean id="myTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
      <ref local="sessionFactory"/>
    </property>
  </bean>
  
   <bean id="torinukeDAOTarget" class="co.hitachi.zaim.dao.hibernate.KyTorinukesDAO">
    <property name="sessionFactory" ref="sessionFactory"/>
  </bean>
  
   <bean id="torinukeDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="proxyInterfaces">
      <value>co.hitachi.zaim.dao.IKyTorinuke</value>
    </property>
    <property name="interceptorNames">
      <list>
        <value>hibernateInterceptor</value>
        <value>torinukeDAOTarget</value>
      </list>
    </property>
  </bean>
  
   <bean id="torinukeTarget" class="co.hitachi.zaim.service.impl.TORINUKEServiceImpl">
      <property name="KY_TORINUKE_TGDAO" ref="torinukeDAO"/>
   </bean>
   
  <bean id="viewManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager">
      <ref bean="myTransactionManager"/>
    </property>
    <property name="target">
      <ref bean="torinukeTarget"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_SUPPORTS</prop>
      </props>
    </property>
  </bean>

解决方案 »

  1.   

    Hibernate中IKyTorinuke.java
    package co.hitachi.zaim.dao;
    public interface IKyTorinuke extends DAO {
        public Object getTorinuke(String nendo);
    }
    Hibernate中KyTorinukesDAO.java
    package co.hitachi.zaim.dao.hibernate;
    public class KyTorinukesDAO extends BaseDAOHibernate implements IKyTorinuke {
        public Object getTorinuke(String nendo) {
         List result = getHibernateTemplate().find("from table1 order by id");
         if (result != null && result.size() > 0) { 
                return result.get(0); 
            } else { 
                return null; 
            }
        }
    }
      

  2.   

    Spring 中TORINUKEService.java
    package co.hitachi.zaim.service;
    public interface TORINUKEService {
        public Object getTorinukes(String nendo);
    }Spring 中TORINUKEServiceImpl.java
    package co.hitachi.zaim.service.impl;
    public class TORINUKEServiceImpl extends BaseManager implements TORINUKEService {
        private IKyTorinuke dao;    public Object getTorinukes(String nendo) {
            return dao.getTorinuke(nendo);
        }    public void setTorinukes(IKyTorinuke KY_TORINUKE_TGDao) {
           this.dao = KY_TORINUKE_TGDao;
        }
    }
    那里不对呀?谢谢各位帮忙了!
      

  3.   

    刚接触不久,看了错误码文件,就该是你的类中get/set方法有误了,
    <bean id="myDao" ....>
    setMyDao()
    getMyDao()
    感觉是这里有问题吧||对某一些DAO中的属性问题的了!
    望大家指点!
      

  4.   

    初学技术,问题好多!谢谢指点,但还是不太明白,是说在Dao中也要加Set方法么?
      

  5.   

    <bean id="torinukeTarget" class="co.hitachi.zaim.service.impl.TORINUKEServiceImpl">
          <property name="KY_TORINUKE_TGDAO" ref="torinukeDAO"/>
    </bean>
    [co.hitachi.zaim.service.impl.TORINUKEServiceImpl]: Bean property 'KY_TORINUKE_TGDAO' is not writable or has an invalid setter method配置文件中声明的property name应与类中的变量name对应,并有对应的setter方法
      

  6.   

    set方法可能没有写或者写的部队,是在实现的地方加set方法,你可以断点跟踪一下,看看是否走过去了
      

  7.   

    谢谢各位,虽然以上的问题我还没有试成功,但是我用Myeclipse重新打了一次环境,这个问题没有了,但是又出了新问题,摆脱各位在给咱看看!万分感谢
    http://community.csdn.net/Expert/topic/4648/4648490.xml?temp=.1190454
      

  8.   

    TORINUKEServiceImpl里要有..getKY_TORINUKE_TGDAO 与setKY....
    什么乱乱的,,name不能大写..TORINUKEServiceImpl">
          <property name="KY_TORINUKE_TGDAO