Category "spring"

pgp_sym_decrypt not working with JPA nativeQuery. Always throw error

Hi I'm working on a Spring Boot Project using PSQL. I have a model that is implemented pgcrypto like this, @ColumnTransformer( read = "pgp_sym_decrypt( ms

Caused by: java.lang.IllegalArgumentException: Value was not an array [java.util.ArrayList]

I am trying to save the List<byte[]> object in Postgres DB, but I am getting the below error. Caused by: java.lang.IllegalArgumentException: Value was not

How to add "allowDiskUse" in @Aggregation annotation in repository in Spring Boot?

I have an aggregation written in a MyRepository.kt file which is being called from MongoDataRetriever.kt file in the backend. MyRepository.kt file: import org.s

Invalid mime type in spring rest template?

I am just trying to make a simple REST request like below String url = "some url"; MultiValueMap<String, String> headers = new LinkedMultiValueMap<>

@ConfigurationProperties vs @PropertySource vs @Value

I am new to Spring/Spring Boot. I want to use the key-value pair data of application.properties / application.yml in Java file. I know that we can use @Value in

How to start single Spring Boot Microservice on Multiple Ports in STS/eclipse? [closed]

How to start single Spring Boot Microservice on Multiple Ports in STS/eclipse ? Means one app is running on 8080 port. So how we can run the

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