解决:Initialization of bean failed; nested exception is java.lang.AbstractMethodError
2018-01-24 16:36
555 查看
环境
Spring Data Jpa + Hibernate使用版本
hibernate <hibernate.version>5.2.10.Final</hibernate.version> Spring Data Jpa <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>2.0.2.RELEASE</version> </dependency>
错误发生点
@Repository public interface UserDao extends JpaRepository<SYS_USER,String>,JpaSpecificationExecutor<SYS_USER>{ /** * 根据用户名查找用户 * * @param username 用户名 * @return SYS_USER */ SYS_USER findByUsername(String username); }
控制台输出
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Initialization of bean failed; nested exception is java.lang.AbstractMethodError at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:522) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318) ... 74 more
原因
直接原因:不能实例化bean。间接原因:版本冲突
解决
降低 spring-data-jpa 的版本<version>1.11.9.RELEASE</version>
相关文章推荐
- Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.Cl
- Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm
- 在使用hibernate 和spring 构架的框架中如果出现Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm
- Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcep
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:问题解决
- Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: null
- Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weave
- Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcep
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:问题解决
- Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExce
- Initialization of bean failed; nested exception is java.lang.StackOverflowError
- Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcep
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlMapClient' is required的解决办法及详细介绍
- spring quartz:Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeErr 分类: Java spring 2015-01-07 19:00 437人阅读 评论(0) 收藏
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError
- spring quartz:Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeErr 分类: Java spring 2015-01-07 19:00 438人阅读 评论(0) 收藏
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError
- spring quartz:Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeErr