2 fengfuyudi fengfuyudi 于 2013.06.10 14:21 提问

用spring对hibernate更新添加事务时出错

log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ClassCastException: $Proxy4 cannot be cast to com.sc.bx.service.imp.UserService
at com.sc.bx.model.test.(test.java:13)
at com.sc.bx.model.test.main(test.java:26)

1个回答

yulin_zhang
yulin_zhang   2017.09.27 18:04

有两个解决方法:
1、在aop:config标签上加上proxy-target-class=”true”
/aop:config
2、使用配置在spring xml

Csdn user default icon
上传中...
上传图片
插入图片