定时任务中注入的应该是接口

<bean id="testSynchronize" class="com.myweb.task.testSynchronize" />
    控制定时任务  
    <task:scheduled-tasks>  
       每天晚上20:33更新缓存
        <task:scheduled ref="testSynchronize" method="startSynchronize" cron="0 33 20 * * ?" />
    </task:scheduled-tasks>

 

 

 

错误描述:but was actually of type [com.sun.proxy.$

 

 

解决:testSynchronize注入的必须是接口, 不可以是实现类

 

posted on 2017-03-22 20:54  SkyBall  阅读(132)  评论(0编辑  收藏  举报