Home > other >  Spring Boot build normal, but throw javax.mail. Naming. NameNotFoundException: name: remaining runti
Spring Boot build normal, but throw javax.mail. Naming. NameNotFoundException: name: remaining runti

Time:09-19

I have an existing application by gradle build normal but when I am through embedded tomcat server running, I get the following exception. Any idea on how to solve?


Org. Springframework. Beans. Factory. BeanCreationException: Error
Creating a bean with the name 'mbeanExporter defined in the 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. The annotation. AnnotationMBeanExporter] :
The Factory method 'mbeanExporter threw the exception; Nested exception is
Org. Springframework. Beans. Factory. BeanCreationException: Error
Creating a bean with the name 'mbeanServer defined in the 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.mail management MBeanServer] : the Factory method
'mbeanServer threw the exception; Nested exception is
Org. Springframework. JMX. MBeanServerNotFoundException: Failed to
Retrieve WebLogic MBeanServer from JNDI; Nested exception is
Javax.mail. Naming. NameNotFoundException: remaining name: env/JMX/runtime
The at
Org. Springframework. Beans. Factory. Support. ConstructorResolver. InstantiateUsingFactoryMethod (ConstructorResolver. Java: 599)
The at
Org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. InstantiateUsingFactoryMethod (AbstractAutowireCapableBeanFactory. Java: 1119)
The at
Org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. CreateBeanInstance (AbstractAutowireCapableBeanFactory. Java: 1014)
The at
Org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. DoCreateBean (AbstractAutowireCapableBeanFactory. Java: 504)
The at
Org. Springframework. Beans. Factory. Support. AbstractAutowireCapableBeanFactory. CreateBean (AbstractAutowireCapableBeanFactory. Java: 476)
The at
Org. Springframework. Beans. Factory. Support. AbstractBeanFactory $1. GetObject (AbstractBeanFactory. Java: 303)
The at
Org. Springframework. Beans. Factory. Support. DefaultSingletonBeanRegistry. GetSingleton (DefaultSingletonBeanRegistry. Java: 230)
The at
Org. Springframework. Beans. Factory. Support. AbstractBeanFactory. DoGetBean (AbstractBeanFactory. Java: 299)
The at
Org. Springframework. Beans. Factory. Support. AbstractBeanFactory. GetBean (AbstractBeanFactory. Java: 194)
The at
Org. Springframework. Beans. Factory. Support. DefaultListableBeanFactory. PreInstantiateSingletons (DefaultListableBeanFactory. Java: 755)
The at
Org. Springframework. Context. Support. AbstractApplicationContext. FinishBeanFactoryInitialization (AbstractApplicationContext. Java: 757)
The at
Org. Springframework. Context. Support. AbstractApplicationContext. Refresh (AbstractApplicationContext. Java: 480)
The at
Org. Springframework. Boot. Context. Embedded. EmbeddedWebApplicationContext. Refresh (EmbeddedWebApplicationContext. Java: 118)
The at
Org. Springframework. Boot. SpringApplication. Refresh (SpringApplication. Java: 687)
The at
Org. Springframework. Boot. SpringApplication. Run (321) SpringApplication. Java:
The at
Org. Springframework. Boot. SpringApplication. Run (967) SpringApplication. Java:
The at
Org. Springframework. Boot. SpringApplication. Run (956) SpringApplication. Java:
At com. Avada. Main. Application. The main (15) Application. Java:

CodePudding user response:

I met the same problem, and through out of the Spring Boot configuration JmxAutoConfiguration class to repair it.

@ SpringBootApplication (exclude=JmxAutoConfiguration. Class)
Public class Application {... }

Seems Spring is trying to create a detected in weblogic API library bean (mbeanExporter), the bean need env/JMX/runtime JNDI.

CodePudding user response:

Start the class need to increase the @ EnableAutoConfiguration annotations (exclude=JmxAutoConfiguration. Class), or you will quote javax.mail. Naming. NameNotFoundException: remaining name: env/JMX/runtime exception, reason may be that the Spring boot startup trying to create a detected in weblogic API library bean (mbeanExporter), the bean need env/JMX/runtime JNDI. So let's remove the JMX automatic configuration,
Details are available at https://www.cnblogs.com/wuyongyin/p/11753885.html

CodePudding user response:

  • Related