- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed
Description
Robert Thaler opened SPR-11647 and commented
After upgrading to Spring Framework 4.0.3 we are receiving a NoSuchBeanDefinitionException on start up of our web application.
This did not occur using Spring Framework 4.0.2.
We have the following spring java configuration for the web application:
@Configuration
@Import( value = { ServiceConfig.class, ... } )
public class MainConfig {
  // ....
}
@ComponentScan( packages = { "some.service.package" } )
public class ServiceConfig {
}
The web.xml configuration looks as follows:
<context-param>
	<param-name>contextClass</param-name>
	<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</context-param>
	
<context-param>
	<param-name>contextConfigLocation</param-name>
	<param-value>my.webapp.config</param-value>
</context-param>
<listener>
	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>After some investigation I have found out that it works if I specify a distinct configuration class instead of a package.
So using my.webapp.config.MainConfig for the context param contextConfigLocation works, but if I have understood the documentation correctly, it should work with a package path too.
Affects: 4.0.3
Attachments:
- error-debug.log (723.72 kB)
- error-info.log (12.18 kB)
- success-debug.log (1.08 MB)
- success-info.log (8.21 kB)
1 votes, 6 watchers
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug