Caused by: java.lang.VerifyError: Cannot inherit from final class
2017-12-21 11:03
866 查看
背景:引入多个测试的client包后,运行TC时,报错:
排查过程:
1)确定aeProductPostPropertyCacheDao 没有继承final的方法;
2)怀疑是类冲突导致,全局搜索aeProductPostPropertyCacheDao,仅找到一个实现类
3)gogle发现有人有同样问题,继续排查是否有重复的包依赖。最后,将提报的测试包,依次删除,仅留单个包时,TC运行通过。
确认是冲突导致的。
后打印依赖树,确实果然有重复依赖。
解决方式:
1)根据依赖树,原来提报的修改过的二方包有7个,这样在pom中只引入2个二方包即可,其余的已通过这2个包间接引入。
遗留问题:
1)既然有冲突,为什么,全局搜索的时候,仅搜到了一个aeProductPostPropertyCacheDao类;
2)发生的具体原理见下方参考
查了很多参考文献,最后根据这个解决:https://stackoverflow.com/questions/40829949/java-lang-verifyerror-cannot-inherit-from-final-class-when-using-spring-boot-da
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aeProductPostPropertyCacheDao' defined in URL [jar:file:/Users/jinyun/.m2/repository/com/aliexpress/category/open.aecategory.pyramidclient/1.0.38-SNAPSHOT/open.aecategory.pyramidclient-1.0.38-20171219.162546-8.jar!/biz/spring/spring_py_client_dal.xml]: Initialization of bean failed; nested exception is java.lang.VerifyError: Cannot inherit from final class at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269) ... 43 more Caused by: java.lang.VerifyError: Cannot inherit from final class at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
排查过程:
1)确定aeProductPostPropertyCacheDao 没有继承final的方法;
2)怀疑是类冲突导致,全局搜索aeProductPostPropertyCacheDao,仅找到一个实现类
3)gogle发现有人有同样问题,继续排查是否有重复的包依赖。最后,将提报的测试包,依次删除,仅留单个包时,TC运行通过。
确认是冲突导致的。
后打印依赖树,确实果然有重复依赖。
解决方式:
1)根据依赖树,原来提报的修改过的二方包有7个,这样在pom中只引入2个二方包即可,其余的已通过这2个包间接引入。
遗留问题:
1)既然有冲突,为什么,全局搜索的时候,仅搜到了一个aeProductPostPropertyCacheDao类;
2)发生的具体原理见下方参考
查了很多参考文献,最后根据这个解决:https://stackoverflow.com/questions/40829949/java-lang-verifyerror-cannot-inherit-from-final-class-when-using-spring-boot-da
相关文章推荐
- 使用paoding lucene分词 ,遇到java.lang.VerifyError: Cannot inherit from final class 问题
- Error!]the type java.lang.object cannot be resolved. it is indirectly referenced from required .class files
- Eclipse error: The type java.lang.Object cannot be resolved. It is indirectly referenced from the required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- j疑难杂症:java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBlobType overrides final method getReturnedClass.()Ljava/lang/Class;
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- he type java.lang.object cannot be resolved. it is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- Websphere 8.5报 java.lang.VerifyError: JVMVRFY007 final method overridden; class=net/sf/cglib/core/De
- The type java.lang.Object cannot be resolved.It is indirectly referenced from required.class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- eclipse中java文件报错:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class file