Snippets tagged “spring-boot”
12 snippets use this tag.
- Add context path to Spring Boot applicationJava
To add a context path to a Spring Boot application, you can use the server.context-path property in the application's application.properties file.
- How can I log SQL statements in Spring Boot?Java
To log SQL statements in Spring Boot, you can configure the logging level of the org.hibernate.SQL logger to DEBUG or TRACE.
- How to access a value defined in the application.properties file in Spring BootJava
To access a value defined in the application.properties file in Spring Boot, you can use the @Value annotation and the Environment interface.
- How to configure port for a Spring Boot applicationJava
To configure the port for a Spring Boot application, you can use the server.port property in the application's configuration file. The configuration file can be a application.properties file in the classpath, or a application.yml file in the classpath.
- intellij incorrectly saying no beans of type found for autowired repositoryJava
If IntelliJ is saying "No beans of type 'X' found for autowiring" for a repository that you are trying to autowire, it means that the Spring application context does not contain a bean of the specified type.
- Returning JSON object as response in Spring BootJava
To return a JSON object as a response in Spring Boot, you can use the @ResponseBody annotation and the ObjectMapper class.
- Setting active profile and config location from command line in spring bootJava
To set the active profile and the configuration location from the command line in Spring Boot, you can use the spring.profiles.active and spring.config.name properties.
- Spring Boot - Cannot determine embedded database driver class for database type NONEJava
If you are seeing the error "Cannot determine embedded database driver class for database type NONE" in a Spring Boot application, it means that the application is trying to auto-configure an embedded database, but it is unable to determine which database
- Spring Boot - Error creating bean with name 'dataSource' defined in class path resourceJava
The error "Error creating bean with name 'dataSource' defined in class path resource" in Spring Boot typically indicates that there is a problem with the configuration of the dataSource bean.
- Spring Boot - How to log all requests and responses with exceptions in single place?Java
In a Spring Boot application, you can log all requests and responses, along with exceptions, in a single place by using a combination of Spring Boot's logging framework and request/response interceptors.
- Spring Boot and multiple external configuration filesJava
To use multiple external configuration files with Spring Boot, you can use the spring.config.name property to specify the names of the configuration files.
- Using env variable in Spring Boot's application.propertiesJava
You can use environment variables in your application.properties file by using the spring.profiles.active property.