spring - org.springframework.aop.framework.Cglib2AopProxy WARN - 无法代理方法

标签 spring hibernate tomcat cglib

我的web项目部署在tomcat上,在final方法上spring和hibernate proxy出现一些警告,请问是什么原因导致的?

2017-09-08 16:01:32,548 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,548 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,548 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,548 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,548 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,995 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,995 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,995 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,995 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:32,995 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,049 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,049 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,049 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,049 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,049 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,112 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,112 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,112 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,113 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:33,113 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,073 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,073 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,073 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,073 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,073 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,678 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,678 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,678 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,679 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,679 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,700 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.HibernateDaoSupport.getSessionFactory()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,700 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,700 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final org.springframework.orm.hibernate3.HibernateTemplate org.springframework.orm.hibernate3.support.HibernateDaoSupport.getHibernateTemplate()] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,700 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2017-09-08 16:01:35,700 org.springframework.aop.framework.Cglib2AopProxy WARN  - Unable to proxy method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is final: All calls to this method via a proxy will be routed directly to the proxy.

最佳答案

看这里。 Spring boot - Unable to proxy interface-implementing method - WARN message

造成这种情况的一个常见原因是在类级别而不是接口(interface)使用 Springs @Transactional 注释。

关于spring - org.springframework.aop.framework.Cglib2AopProxy WARN - 无法代理方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46111715/

相关文章:

java - 使用 Tomcat 提供所有 Web 内容

tomcat - 如何为部署在 CloudFoundry 上的应用程序配置公共(public)端口?

java - Spring 4.2.3 与 Hibernate validator 5.2.2.Final 不起作用

java - 使用 JsonItemReader 解析文件名并处理每条记录

java - 无法使用 Spring javamail 在电子邮件中发送图像

java - hibernate 错误:- Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]

java - 如何为带有子选择的查询编写 HIbernate 条件

java - 是否可以通过 Firebase 托管托管 Java Spring 应用程序?

java - Hibernate 看不到名称中带有引号的表

java - 如果我使用 Java 8 库编写应用程序代码并尝试使用 Java 6 编译器编译它,构建是否会/应该失败?