Upon upgrading the spring-boot-parent to 2.2.0.RELEASE, my freemarker based Spring Boot Web application fails to properly serve requests.
I have a @Controller that serves /hello with src/main/resources/templates/hello.ftl.
@Controller
class HelloController() {
@RequestMapping(value = ["/hello"])
fun hello(): String {
return "hello"
}
}
upon request, it just lands on an error page saying There was an unexpected error (type=Not Found, status=404)..
Error stacktrace doesn't say much. It just says org.springframework.web.servlet.resource.ResourceHttpRequestHandler: Resource not found.
My pom.xml is basically as follows:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
</dependencies>
It worked perfectly fine up until upgrading to Spring Boot 2.2.0.RELEASE.
What's the problem here?
- This is a self-answering question as per rules to prevent other poor souls from suffering like I did.