在Java中,final关键字用于修饰类、方法和变量。当一个类被final修饰时,表示这个类不能被继承。如果尝试去继承一个final类,就会触发java.lang.IllegalArgumentException异常,并显示错误消息“cannot subclass final class”。 这种情况通常发生在以下几种场景中: 使用代理框架(如Spring AOP、CGLIB等)时,框架会尝试为目标...
static final class BasePackages { ... } 3)java不允许继承被final所修饰的类。 解决方法: 以上问题出现的原因为aop定义的切点条件中,包含了被final所修饰的类。 1)通过修改类的访问修饰符解决。 2)通过调整切点条件,过滤final修饰的类。 本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。 原始发表:...
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.l...
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [classcom.sun.proxy.$Proxy16]: Common causes of this problem include using a final classora non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final cl...
类似以下的spring错误信息: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class $Proxy145]: Common causes of this problem include using a final class or a no ...
<bean id="jbpmTxManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="jbpmEntityManagerFactory" /> <!-- 这里要是为false的话,提交事物的时候,容易报错 --> <property name="nestedTransactionAllowed" value="true" /> </bean> <bean id...
Cannot subclass final class class com.sun.proxy.$Proxy16 1. 这句错误的原因很好理解,就是一个final 不可以被继承了,即final类不能子类化,因此不能代理proxy。 http://stackoverflow.com/上的一个回答, You are not injecting an interface so you need to use CGLIB proxies, the spring ...
Cannot subclass final class class com.sun.proxy.$Proxy16 这句错误的原因很好理解,就是一个final 不可以被继承了,即final类不能子类化,因此不能代理proxy。 http://stackoverflow.com/上的一个回答, You are not injecting an interface so you need to use CGLIB proxies, the spring reference manual sta...
"Could not generate CGLIB subclass of class com.example.demo.functions.MyFunctions$kotlinSupplier2$1: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class com.example.demo.functions.My...
Question Error creating bean with name 'dataSource' Could not generate CGLIB subclass of class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource: Cannot subclass final class org.apache.shardingsphere.driver.j...