Skip to content
Advertisement

Tag: spring-boot

Why component scanning does not work for Spring Boot unit tests?

The service class FooServiceImpl is annotated with @Service aka @Component which makes it eligible for autowiring. Why this class is not being picked up and autowired during unit tests? The test failed to load application context, Full stack trace If test class is annotated with @SpringBootTest then it creates whole application context including database connection and a lot of unrelated

Rest Controller method not getting called in spring boot

I am implementing rest webservice via a spring boot application. POM application.properties Application launcher class Controller I see Did not find handler method for [/services/account] message in the console when I fire http://localhost:8082/services/account URL in the browser as shown below I dont see message – ACCOUNT METHOD CALLED in the console meaning controller method is not getting invoked.Can you please

How to resolve SQLServerException: Invalid object name?

I am creating a spring boot application using MS SQL server. I have a requirement where I need to initialize USERS table in user_database database using data.sql file placed in /src/main/resources/ folder and rest of the tables should be created automatically in springboot_db database with the help of @Table annotation. Below is the code snippet. applicaiton.properties file data.sql AppConfiguration.java (One

What does each table for quartz scheduler signify?

There are few tables that quartz scheduler uses for scheduling jobs and to identify which job is running currently. It uses the following tables : So what is the purpose of each of these tables and what does it siginifies? Thanks in advance. Answer I had the chance to work on quartz recently. I’m myself not 100% clear on this

Spring Boot + MongoDB Id query

I have a Spring Boot application combined with MongoDB as the persistance layer. I have the following structure: I also have a ResourceRepository: I found online that a way to have the id property returned in the JSON when you perform a GET request like http://localhost:8080/resources/ is to change the id property to Id (uppercase i). Indeed, if the property

Spring Test cannot get Spring Configuration Beans

I also tried putting EnvironmentServiceTestConfiguration as a non-inner non-static class, but didn’t help. Here is what I tried in a separate class: didn’t work either The test class is located in test/java/com.bhavya.test package. I am trying to run this particular test test1 This is my first test of such kind. I have never before used AnnotationConfigContextLoader.class, enlighten me. Stacktrace :

How to start up spring-boot application via command line?

I have a spring-boot application which I need to start up by going to the folder directory and start up my web application via command line. I have a class called Application.java and the code inside it is as followed. I set up classpath then tried to run the command “java ApplicationUtility” but I’m getting this error message “Could not

Advertisement