razor
razor

Reputation: 2867

Spring Batch+Boot and: [org/springframework/web/WebApplicationInitializer.class] cannot be opened because it does not exist

I made an example from http://projects.spring.io/spring-batch/#quick-start

and when I try to run application I have an exception:

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: ; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/WebApplicationInitializer.class] cannot be opened because it does not exist
    at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:395)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:165)
2015-04-07 11:00:15.443 ERROR 11912 --- [           main] o.s.boot.SpringApplication               : Application startup failed

What's wrong? project is straightforward and made exactly like on spring batch web page.

Upvotes: 2

Views: 2610

Answers (1)

razor
razor

Reputation: 2867

It looks like

@EnableAutoConfiguration 

on main class spoils the application (tries to initialize too much things?) after removing this annotation, only @SpringBootApplication left, everything is working.

Upvotes: 3

Related Questions