I have multiple spring boot applications in a single IntelliJ project. And i want to have a single button to run all of them in some order. I know there is an option to Run Another configuration before launching the original one, so in that way the configurations can be chained. But when i use it, it runs tha…
Tag: spring-boot
Spring Boot init.d not Not running (process not found)
I was trying to follow the instructions from here, where trying to run the Spring Boot app as init.d service but could not successfully. I created the fully executable jar (myapp.jar) as mentioned and also created the symlink to /etc/init.d/myapp When I run the java -jar myapp.jar I could see the application …
Overriding beans in Integration tests
For my Spring-Boot app I provide a RestTemplate though a @Configuration file so I can add sensible defaults(ex Timeouts). For my integration tests I would like to mock the RestTemplate as I dont want to connect to external services – I know what responses to expect. I tried providing a different impleme…
Spring Boot @ExceptionHandler hide Exception Name
I am using Spring Boot 1.3.X and have the following: Which works as expected. When passing a wrong param, the following exception is raised: I then created an ExceptionHandler as seen below: Which raises the following Exception: Is it possible to exclude the exception field from the JSON representation? Answe…
Does Spring Boot support multimodule maven projects?
I’m just curious about the level of support Spring Boot has for multimodule maven projects. There’s so much work that has to be done when creating a good layered set of projects (especially getting the various JPA/JDO enhancers set up). All of the samples I’ve seen put everything into one pr…
Scheduler not running in Spring Boot
I have created a Spring Boot application. I have configured my class that contains the scheduler method startService(). Below is my code : Service Class : Main Class : I have annotated the class as @Component and also method as @Scheduled(fixedRate = 30000) that will running as a scheduler. But while running …
How to re-create database before each test in Spring?
My Spring-Boot-Mvc-Web application has the following database configuration in application.properties file: this is the only config I made. No any other configurations made by me anywhere. Nevertheless the Spring and subsystems are automatically recreate database on each web application run. Database is recre…
Spring Boot classpath
In the Spring Boot’s docs here, about serving static content, it says: By default Spring Boot will serve static content from a directory called /static (or /public or /resources or /META-INF/resources) in the classpath. I found that all the content in the directory: will be copied inside the classpath, …
Serving HTML pages in a Spring Boot application
I have a Spring Boot Application. I am trying to pass a variable to a HTML page but unfortunately I cannot seem to do it, on application start nothing is rendered except the static text: “WORLD”. My controller is as below: And my index.html: I was looking for an answer and I found these articles: …
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
I just upgraded to IntelliJ 15.0 from 14.1 (I was in a hurry and forgot to save the previous plug state for 14.1) and I’m attempting to configure general run/debug configuration settings with Spring Boot in Intellij using Gradle. In the configuration tab I have added 1) the Main class, 2) JRE, and 3) cl…