Home Spring boot not recognizing Controller
Reply: 0

Spring boot not recognizing Controller

user5029
1#
user5029 Published in May 20, 2018, 10:14 am

I have a spring boot app which is configured to generate war. When i run it, the application starts and seems to work but the controllers don't (logs that show mapping of urls to controllers are not displayed and localhost:8080 does'nt work either) even though my package structure is well organized (i believe).

Please note that home.html exists in templates directory and server.port=8080 set in application.properties and when i trace the app these are the important logs maybe:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.scheduling.TaskScheduler' available
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:990) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.resolveSchedulerBean(ScheduledAnnotationBeanPostProcessor.java:291) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.finishRegistration(ScheduledAnnotationBeanPostProcessor.java:232) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:209) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ScheduledAnnotationBeanPostProcessor.java:100) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:353) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:887) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
    at i.p.tv.TvApplication.main(TvApplication.java:25) [classes/:na]

2018-01-13 10:02:09.964 TRACE 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'LOCAL.SERVER_PORT' in PropertySource 'configurationProperties'
2018-01-13 10:02:09.964 TRACE 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'LOCAL.SERVER_PORT' in PropertySource 'systemProperties'
2018-01-13 10:02:09.964 TRACE 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'LOCAL.SERVER_PORT' in PropertySource 'systemEnvironment'
2018-01-13 10:02:09.964 TRACE 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'LOCAL.SERVER_PORT' in PropertySource 'random'
2018-01-13 10:02:09.964 TRACE 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'LOCAL.SERVER_PORT' in PropertySource 'applicationConfig: [classpath:/application.properties]'
2018-01-13 10:02:09.964 TRACE 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'LOCAL.SERVER_PORT' in PropertySource 'class path resource [config.properties]'
2018-01-13 10:02:09.964 DEBUG 11852 --- [)-85.185.163.44] o.s.c.e.PropertySourcesPropertyResolver  : Could not find key 'LOCAL.SERVER_PORT' in any property source

My settings if that helps:

gradle build file

main class

servlet initializer

controller

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304533 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO