使用名称springApplicationAdminRegistrar创建bean时出错

时间:2015-12-08 13:31:36

标签: java spring spring-boot

我将项目从Spring Boot版本从1.2.3.RELEASE迁移到1.3.0.RELEASE后,我开始遇到异常。

  

使用名称' springApplicationAdminRegistrar'创建bean时出错。   在类路径资源中定义   [组织/ springframework的的/ boot /自动配置/管理/ SpringApplicationAdminJmxAutoConfiguration.class]:   调用init方法失败;嵌套异常是   javax.management.InstanceAlreadyExistsException:   org.springframework.boot:类型=管理员,名字= SpringApplication

围绕此错误的Stacktrace是:

WARN  o.s.c.a.AnnotationConfigApplicationContext:545 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
INFO  o.s.j.e.a.AnnotationMBeanExporter:449 - Unregistering JMX-exposed beans on shutdown
WARN  o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userManagementDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\UserManagementDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
WARN  o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userManagementDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\UserManagementDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
WARN  o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userManagementDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\UserManagementDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'getSqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
WARN  o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sampleDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\SampleDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.entities.master.Method; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.MyEntity
WARN  o.s.b.f.s.DefaultListableBeanFactory:1480 - Bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sampleDAO' defined in file [${PATH_TO_PROJECT}\target\classes\com\mycom\myproject\mappers\SampleDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.entities.master.Method; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSqlSessionFactory' defined in class path resource [com/mycom/myproject/config/DAOConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mycom.myproject.MyEntity

任何指向调试此问题的指针?

1 个答案:

答案 0 :(得分:0)

上下文是从用于获取bean的代码手动加载(Java代码),删除哪个解决了问题。 但是我的问题已经解决了,但仍然不确定它是如何使用最新版本的spring boot。