: The following classes could not be excluded because they are not auto-configuration classes: 13:13:13.051 ERROR 79761 - o.s.boot.SpringApplication : Application run failed Let us see if the below configuration works or not? ![]() Now, we have to tell spring to configure all these as below. When I hit localhost:8080/api/v1/send api, it returns 404 always.īecause created controller and beans are not registered with spring because these are not auto-configured by spring even though is enabled. 12:44:32.079 INFO 78470 - o.s. : Initializing Servlet 'dispatcherServlet' : Initializing Spring DispatcherServlet 'dispatcherServlet' 12:44:01.967 INFO 78470 - c.j.a.c.AutoConfigureApplication : Started AutoConfigureApplication in 2.135 seconds (JVM running for 2.708) 12:44:01.796 INFO 78470 - o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index ![]() 12:44:01.711 INFO 78470 - o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 12:44:01.528 INFO 78470 - o.s. : Root WebApplicationContext: initialization completed in 996 ms : Initializing Spring embedded WebApplicationContext 12:44:01.441 INFO 78470 - .StandardEngine : Starting Servlet engine: 12:44:00.501 INFO 78470 - c.j.a.c.AutoConfigureApplication : No active profile set, falling back to default profiles: default 12:44:00.498 INFO 78470 - c.j.a.c.AutoConfigureApplication : Starting AutoConfigureApplication on.local with PID 78470 (/Users/Spring-Boot-Tutorials/target/classes started by in /Users/workspace/Spring-Boot-Tutorials) It makes beans eligible for persistence exception translation - which means to convert low level ORM exceptions to a generic exception which is managed and handled by Spring instead of the O/R mapping tools like Hibernate, and cannot be replaced by because it has got their own specific role, gives clear ideas to the developers on the role of each class, and are prone to changes by the SpringBoot team for additional features.( ( )\_ | '_ | '_| | '_ \/ _` | \ \ \ \ Service layer holds your business logic which is called from the controller classes at the persistence layer, which will act as a database repository. ![]() When a request is made, this annotation tells the dispatcher servlet to look for the required endpoint request path in the components marked with classes at the service layer. ![]() import import .SpringBootApplication // same as and public class Application This class automatically creates the ApplicationContext from the classpath, scans the configuration classes and launches the Spring Boot 1.2.0, we can use this annotation which is the same as declaring together. Spring Boots SpringApplication class is used to bootstrap and launch a Spring application from a Java main method. The interface represents the Spring IoC container and is responsible for instantiating, configuring, and assembling the beans Annotation makes it easier to configure dependency injection and define/manage beans in spring.
0 Comments
Leave a Reply. |