我有一個現有的應用程式通過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)
uj5u.com熱心網友回復:
我遇到了同樣的問題,并通過從Spring Boot配置中排除JmxAutoConfiguration類來修復它.@SpringBootApplication(exclude = JmxAutoConfiguration.class)
public class Application {...}
看起來Spring試圖創建一個在weblogic api庫中檢測到的bean(mbeanExporter),這個bean需要env / jmx / runtime JNDI.
uj5u.com熱心網友回復:
在啟動類中需增加@EnableAutoConfiguration(exclude = JmxAutoConfiguration.class)注解,否則會報javax.naming.NameNotFoundException: remaining name: env/jmx/runtime例外。原因可能是Spring boot啟動時試圖創建一個在weblogic api庫中檢測到的bean(mbeanExporter),這個bean需要env/jmx/runtime JNDI;所以要去除JMX的自動配置。具體內容可查看https://www.cnblogs.com/wuyongyin/p/11753885.html
uj5u.com熱心網友回復:
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/49814.html
標籤:其他技術討論專區
上一篇:ARM開發非接觸式噴墨打標機
下一篇:U盤問題
