CGLIB 問題

全部錯誤信息如下:(爲了大家能搜到,拼了,全部截下來~)

[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [protected final org.hibernate.Session org.springframework.orm.hibernate5.support.HibernateDaoSupport.currentSession() throws org.springframework.dao.DataAccessResourceFailureException] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate5.support.HibernateDaoSupport.getSessionFactory()] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final void org.springframework.orm.hibernate5.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [protected final void org.springframework.orm.hibernate5.support.HibernateDaoSupport.checkDaoConfig()] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final void org.springframework.orm.hibernate5.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate5.HibernateTemplate)] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final org.springframework.orm.hibernate5.HibernateTemplate org.springframework.orm.hibernate5.support.HibernateDaoSupport.getHibernateTemplate()] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] WARN org.springframework.aop.framework.CglibAopProxy - Unable to proxy interface-implementing method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is marked as final: Consider using interface-based JDK proxies instead!
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [protected final org.hibernate.Session org.springframework.orm.hibernate5.support.HibernateDaoSupport.currentSession() throws org.springframework.dao.DataAccessResourceFailureException] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate5.support.HibernateDaoSupport.getSessionFactory()] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final void org.springframework.orm.hibernate5.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [protected final void org.springframework.orm.hibernate5.support.HibernateDaoSupport.checkDaoConfig()] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs against uninitialized fields in the proxy instance.
[main] INFO org.springframework.aop.framework.CglibAopProxy - Final method [public final void org.springframework.orm.hibernate5.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate5.HibernateTemplate)] cannot get proxied via CGLIB: Calls to this method will NOT be routed to the target instance and might lead to NPEs again

單元測試總是起不來(10分鐘後能起來,但是調試下一步也非常慢!),一直在重複上面的錯誤信息。

針對這個問題,找了一下午!

說一下我的解決方案:

調試時,查看所有斷點,然後把Java Exception Breakpoints取消選中!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章