我有一个现有的应用程序通过gradle构建正常但是当我通过嵌入式tomcat服务器运行时,我得到以下异常.有关如何解决的任何想法?
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘mbeanExporter’ defined in class path resource
[org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.class]:
Bean instantiation via factory method Failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.jmx.export.annotation.AnnotationMBeanExporter]:
Factory method ‘mbeanExporter’ threw exception; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘mbeanServer’ defined in class path resource
[org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.class]:
Bean instantiation via factory method Failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [javax.management.MBeanServer]: Factory method
‘mbeanServer’ threw exception; nested exception is
org.springframework.jmx.MBeanServerNotFoundException: Failed to
retrieve WebLogic MBeanServer from JNDI; nested exception is
javax.naming.NameNotFoundException: remaining name: env/jmx/runtime
at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at
org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.instantiateUsingFactoryMethod(AbstractAutowireCapablebeanfactory.java:1119)
at
org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBeanInstance(AbstractAutowireCapablebeanfactory.java:1014)
at
org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(AbstractAutowireCapablebeanfactory.java:504)
at
org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(AbstractAutowireCapablebeanfactory.java:476)
at
org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:303)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:299)
at
org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194)
at
org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(DefaultListablebeanfactory.java:755)
at
org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:757)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
at com.avada.main.Application.main(Application.java:15)
解决方法:
我遇到了同样的问题,并通过从Spring Boot配置中排除JmxAutoConfiguration类来修复它.
@SpringBootApplication(exclude = JmxAutoConfiguration.class)
public class Application {...}
看起来Spring试图创建一个在weblogic api库中检测到的bean(mbeanExporter),这个bean需要env / jmx / runtime JNDI.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。