-
Couldn't load subscription status.
- Fork 38.8k
Closed
Closed
Copy link
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
This is an example of a log XmlWebApplicationContext produces when there is no certain classes in the classpath:
[03 Dec 2024 00:04:49,357][WARN ][XmlWebApplicationContext,main] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Cannot create inner bean '(inner bean)#736f2fb8' of type [org.springframework.web.bind.support.ConfigurableWebBindingInitializer] while setting bean property 'webBindingInitializer'
[03 Dec 2024 00:04:49,357][WARN ][ClassPathXmlApplicationContext,main] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webContext' defined in class path resource [context/bootstrap.xml]: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Cannot create inner bean '(inner bean)#736f2fb8' of type [org.springframework.web.bind.support.ConfigurableWebBindingInitializer] while setting bean property 'webBindingInitializer'
As you can see, this log completely omits any useful details and is not useful for tracking a root case.
The culprit is AbstractApplicationContext#refresh logging the exception in the following way:
catch (RuntimeException | Error ex ) {
if (logger.isWarnEnabled()) {
logger.warn("Exception encountered during context initialization - " +
"cancelling refresh attempt: " + ex);
}
//...
}
The problem is present on all 6.x Spring versions.
The only way to trace a route cause was to put a breakpoint on the logging line in Spring code.
Metadata
Metadata
Assignees
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid