解决spring but was actually of type 'com.sun.proxy.$Proxy**'的问题(转)
在spring配置文件里的
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
下面加上
<tx:annotation-driven proxy-target-class="true" transaction-manager="transactionManager"></tx:annotation-driven>