Spring

Spring Boot common Error :- There was an unexpected error (type=Not Found, status=404)

This issue is related to package of spring boot application main class.

For Example Error will come if package structure will like below:

Main class package: com.org.currency.api.currencyapi

Controller Class package : com.org.currency.api.controller

You can fix this by either moving your controller (or application), or adding ComponentScan to your Application:

Like :
Main class package: com.org.currency.api.currencyapi and Controller class package should : com.org.currency.api.currencyapi.controller

Or

@SpringBootApplication
@ComponentScan(basePackageClasses=HelloController.class)
public class Application {

Leave a Reply

Your email address will not be published. Required fields are marked *