I am using Gradle to build and package a very simple spring boot application (99% static content) into a jar with embedded tomcat. I tried creating said jar, at first the result was 86k and did not launch, because it was missing some Spring boot classes. I concluded this jar I made contained none of the application’s dependencies, and since
Tag: spring-boot
spring boot starter security post methods not working
I have added spring ‘spring-boot-starter-security’ to existing spring boot project ; after that the post methods in spring rest controller not working properly it shows a error something like this : my controller method is this: pom file: if i remove all these security related stuff the code is working great . Is there any thing wrong in my configuration
Externalizing the location of logback.xml in Spring Boot using application.properties
How can I customize the location of logback.xml in Spring Boot using application.properties? I tried below but is not working. application.properties It is working if the logback.xml is located in the resource folder, but not working if it is located outside the project. It is also working if the I supply as an environment variable like Answer Below construct worked
Embedded Redis for Spring Boot
I run my Integration Test cases with Spring Boot with the help of my local Redis server on my machine. But I want an embedded Redis server which is not dependent on any server and can run on any environment, like the H2 in-memory database. How can I do it? Answer You can use an embedded Redis like https://github.com/kstyrc/embedded-redis Add
org.postgresql.util.PSQLException: ERROR: relation “app_user” does not exist
I have an application that I’m using spring boot and postgres. I’m getting this error when I try to create a user. When I run this query on my database, I get the same error: But if I change that to: It works. How can I configure that on my spring boot app? dependencies in pom.xml: application.properties: My entity: I’m
How to load an external property file to Spring Boot in Wildfly
I wonder how can I load an external property of my application running inside Wildfly 9 as WAR, I tried to add a java parameter to Wildfly execution but it seems the application did not recognize the properties. Is there any way how Spring Boot could read the external property file? I am trying to load and run one Spring
Spring Boot Actuator without Spring Boot
I’ve been working on a Spring/Spring MVC application and I’m looking to add performance metrics. I’ve come across Spring Boot Actuator and it looks like a great solution. However my application is not a Spring Boot application. My application is running in a traditional container Tomcat 8. I added the following dependencies I created the following config class. I even
SpringBoot with Thymeleaf – css not found
First to say is that I’ve been searching for a solution for a while now and I’m quite desperate now. I cannot get the css file to be accessible from html page when run by Spring Boot. html.file Application.java folder structure: I’ve tried putting the css folder into a static folder and/or removing the addResourcesHandlers, referencing to the css by
Spring-boot thymeleaf load HTML file from classpath
I’ve a multi module project structure like : and on my controller: I’m getting the error message as below: Is there configuration needed to configure something specially for spring for searching templates on class path? Answer Adding following properties solves my problem:
How to write a unit test for a Spring Boot Controller endpoint
I have a sample Spring Boot app with the following Boot main class Controller What’s the easiest way to write a unit test for the controller? I tried the following but it complains about failing to autowire WebApplicationContext Answer Spring MVC offers a standaloneSetup that supports testing relatively simple controllers, without the need of context. Build a MockMvc by registering