Category "spring-boot"

How to get relationship data with spring boot rest api?

I'm building a REST API with Spring Boot to retrieve boat information. I'm using Spring Data Rest and Spring Data JPA. When I get the data from the API, I don't

Difference between @Mock, @MockBean and Mockito.mock()

When creating tests and mocking dependencies, what is the difference between these three approaches? @MockBean: @MockBean MyService myservice; @Mock: @Mock

Failed to get nested archive for entry BOOT-INF/lib for jar created with maven-shaded-plugin

I am using spring-boot-maven-plugin:2.1.0.RELEASE to package my main line application. This application has all common dependencies etc packaged In a separate

username parameter is empty in loadUserByUsername(String username) - spring boot

This is my UserDetailService: public class StockUserDetailService implements UserDetailsService { @Autowired private UserRepository userRepository;

Dynamic dropdowns using thymeleaf, spring boot

I have 3 dropdowns(one is populate with cities, one with agencies and one with services). If I select one city, the second dropdown should load the data(agencie

How to add scheduled job to all nodes in java springboot cluster?

We have two springboot servers. We use nginx so that the user request will be sent to one of the server node. Now we want to achieve that: After user inputs thr

Performance issue with upgrade of spring boot

We upgraded an spring boot app from 2.0.0.RELEASE to 2.5.5. We use spring integration with queues persisted in Postgresql. We expose API. The embedded server is

How to use math.max in thymeleaf to find maximum number?

While trying to use max function in thymeleaf I got OGNL expressionn everytime. I'm not even sure if we can use functions like max/min in thymeleaf. Tried to lo

scanBasePackages on SpringBootApplication breaks endpoints

I am using an external dependency in my SpringBootApplication. The main class is defined as @ConfigurationPropertiesScan @EnableConfigurationProperties @SpringB

Validate Jwt signature

I have an app with React in the frontend and SpringBoot in the backend for the API, when I login with some user it saves the token in localStorage and you can m

Failing to connect to an Amazon Aurora MySQL from SpringBoot

I want to connect my spring boot application to AWS Aurora MySQL RDS. The problem is while there are plenty of examples of AWS MySQL RDS. I cant find an example

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

I have a spring boot project running on java8 after I installed mysql8 server and tried to connect I am getting the error com.mysql.jdbc.exceptions.jdbc4.MySQ

How to write List<Number> with OpenCSV?

I have the following field inside a StacItem Object: @JsonProperty private List<Number> bbox = null; I made a basic implementation with OpenCSV to write

Getting a 400 bad request response when submitting a form in Thymeleaf to my spring boot application

I am creating a Spring boot application with a thymeleaf front-end. I am trying to create an object of type "expense" (seen in the code snippet below) but, when

@MockBean not fluent with testNG

With JUnit i could use @MockBean easily : @SpringBootTest(classes = AppConfig.class) @RunWith(SpringRunner.class) public @Log class ServiceDrhImplT

how to prevent jdbc from trying to connect to a mysql database during unit testing

I'm making an application for a school project, but I'm running into the issue that when I try to run the unit tests that it tries to connect to the database wh

How to call repository method in entity listener

I'm trying to make call to repository inside my Entity Listener, when I call repository.findById() method inside my @prePersist method the same method is callin

solr exception Expected mime type application/octet-stream but got text/html

Hi I am trying to index an entity in solr using spring boot data solr. But i am getting exception Caused by: org.apache.solr.client.solrj.impl.HttpSolrCli

Spring Boot build image failure for native image

Using spring boot 2.6.2, with java17, trying to create native image but it fails with below error. I am building it on windows 11 machine with docker desktop i

Spring Boot Kotlin Mockito @MockBean dependency throws IllegalStateException null on method call

I am relatively new to Spring and Kotlin. I ran into this problem and it does not seem that there is a comprehensible (for me) explanation anywhere on the Inter