Category "spring"

Disable @CreationTimestamp in testing class

So I'm using Hibernate's annotations @CreationTimestamp and @UpdateTimestamp. It works fine, but I have this case when unit testing where I need to create objec

Override a property for a single Spring Boot test

Consider the following example: @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {

Running into an error after upgrading springboot from 2.3.9 to 2.6.3

After upgrading from springboot 2.3.9 to 2.6.6 I have a failing tests with the following error, java.lang.AssertionError: Expecting: <Unstarted application

Spring Boot: exit jvm on "Application run failed"

Is there a way to react on "Application run failed", e.g. in case when database is unavailable? In my case the desired behavior is to exit the JVM process, so

Live reload for thymeleaf template

When I change a thymeleaf .html file residing inside /templates , I expect the browser to automatically reload the page. I have the live reload plugin installed

Spring SimpleJdbcCall and BeanPropertyRowMapper

To get data from database I'm using SimpleJdbcCall as it is convenient for stored procedures. Along with it I'm using BeanPropertyRowMapper as the no of fields

What are the defaults in Spring @Async?

Could you tell me what are the default parameters for Spring @Async ThreadPoolTaskExecutor or how can I find them one my own? What are the default values for m

Read entire File to String Spring Boot [duplicate]

I have a text file with path as resources/templates/temp.txt. I tried reading it with built in Files.readAllBytes() function found in java.nio

SOAP Proxy with Spring Integration

I'm trying to wrap my head around spring integration and would preferably like to stay away from XML-based configuration. What I would like to do is the follo

Spring WebClient aggregates multiple 401 UNAUTHORIZED error to throw Exceptions.CompositeException

When WebClient calls an external api (with different query params) asynchronously with a wrong token, the first few returns with 401 UNAUTHORIZED and the contro

My custom validation annotation is not working in Spring Boot

i have created an annotation that has features such as checking if the entered string is null or at the assigned value.But the annotation doesn't work. I don't

Spring Boot - Hibernate - Table does not exists

I have a 3rd party jar that holds all the entities and mapping. I am currently using this jar successfully in a classic Spring-MVC application, but now I am t

Authenticate certain endpoints with custom Filter | Spring Security [duplicate]

1. Overview First things first - I am pretty new to Spring Security so if you see something trivial, please keep that in mind 🤓 I am t

Spring - "Content type 'application/json;charset=UTF-8' not supported"

I get this error: { "timestamp": 1507132684098, "status": 415, "error": "Unsupported Media Type", "exception": "org.springframework.web.HttpMediaTypeNo

Create Command-line Launcher Intellij not found

I would like to use idea pom.xml from command line to launch a simple Maven project, and so I think I need to configure using "Create Command-line Launcher"

has been blocked by CORS policy: Response to preflight request doesn't pass

I have created one app using angular and springboot for basic authentication with spring security but i am getting 401 error ..i am novice in springboot @Confi

HikariPool-1 - Exception during pool initialization

I'm deploying Spring-Boot4 project and I have got an error called HikariPool-1 - Exception during pool initialization. 2019-07-05 11:29:43.600 INFO 5084 --- [

Single unexpected null value in a request while testing a rest controller with soapUI

I have a Controller which receives a request object via SoapUI (screen below). What confuses me it is that only one of the 2 attributes of this request object i

Where is the documentation for removing Oauth from Spring Security? [closed]

I know OAuth is now supported by Spring Security, so I want to review the official documentation so that I know how to safely remove it from m

Thymeleaf is trying to build a html which does not exist and which is not called anywhere

I am trying to build a spring mvc app with spring boot and thymeleaf. I am trying to create a form to insert an object into my data base (something which I alre