Questions tagged [spring-boot]

Spring Boot is a framework that allows to easily create Spring-powered, production-grade applications and services with the absolute minimum fuss. It takes an opinionated view of the Spring platform designed to work for new and experienced users of Spring.

0 votes
1 answer
7 views

Actions while logging in java with log4j and slf4j

I am using log4j wrapped with slf4j in my springboot application. Every time I call log.warn() or log.error(), I want to call a function (to increment a count). What's the simplest and cleanest way to ...
  • 102
0 votes
1 answer
11 views

NoClassDefFound is thrown on attempt to create JedisConnectionFactory

I have generated a brand new springboot project using SpringInitializr in my IntellijIDEA (v.2022.2.1). As a result I got pom.xml like this: <?xml version="1.0" encoding="UTF-8"?...
0 votes
0 answers
9 views

Catch optimistick lock exception hibernate spring boot

i'm trying to intercept an optimistick lock exception and throw another exception but it doesn't work in my case, the exception is catched but i still have error optimistick lock in my console. //MY ...
  • 27
0 votes
0 answers
19 views

How do I implement an event listener when the key expires in Spring-Data-Reactive-Redis?

Spring data redis may be implemented as follows. @Component class ExpirationListener : MessageListener { override fun onMessage(message: Message, pattern: ByteArray) { println("##...
0 votes
0 answers
5 views

Camunda -> An exception occurred in the persistence layer

Here Im using camunda platform 7.16 with java 8 - 1.8 When I'm running my project, I get an error as -> org.camunda.bpm.engine.ProcessEngineException: An exception occurred in the persistence layer....
0 votes
1 answer
9 views

JPQL: How to rewrite postgres native query to JPQL query that uses filter keyword

Im trying to avoid using native query. I have this query that uses the filter function, how could I rewrite this to not use that and work in regular jpql? @Query( "SELECT time_bucket(...
  • 143
0 votes
0 answers
36 views

@Value can't get yml value [closed]

When I want to get the value of the yml configuration file, I use @Value("${filepath}") private String path; and my yml is: filepath: xxx but my path is null and I don't know why @...
  • 1
0 votes
0 answers
13 views

How to switch/change bean implementation at runtime spring boot?

I have a parent bean and a child bean in the spring configuration class like attached. How can I inject the child bean dynamically into parent bean based on some condition (like feature toggle). @...
  • 457
0 votes
0 answers
16 views

IntelliJ Idea SpringBoot-Application (Java 19) Allow the device with the front-end aplication to work together with the external back-end application

the question as follows : I have a hardcoded IP-adress inside of the allowlist of the back-end application. Everytime the front-end application is running on another device, the front-end has to get ...
  • 43
0 votes
1 answer
42 views

Duplicate Json in Spring Boot Response

I have a RestController class with a method that returns duplicate json. Weird thing is when I pass a string to the response object. The Json is okay. However when I pass any other object, be it a ...
2 votes
0 answers
18 views

Already existing SecurityFilterChain is preventing my configuration on Spring Security?

I'm making a configuration on the newest Spring Security version. Based on Beans rather than the deprecated WebSecurityConfigurerAdapter. I follow the Spring recomendation on configure a Beanfor ...
0 votes
0 answers
9 views

Can rest template exist along with spring cloud gateway

I have a gateway application which is implemented in Netflix zuul gateway and spring boot 2.4.13. Since, this spring boot version has got vulnerabilities, there is a need to update it to latest ...
0 votes
0 answers
7 views

Thymeleaf- spring error : The origin server did not find a current representation for the target resource or is not willing to disclose that one exis

I have 3 Html files, I tried all of them in IntelliJ's 3 of them worked well. But when I tried in localhost the file I mentioned below is giving an error, an error on the title. package com.example....
0 votes
0 answers
4 views

OpenFeign client with MultipartFile -

Here is my application. @SpringBootApplication @EnableFeignClients public class PostLabApplication { public static void main(String[] args) { SpringApplication.run(PostLabApplication....
  • 1,973
0 votes
0 answers
6 views

Cookie Based Validation in Spring Boot

Can you please explain Cookie based Validation in Spring Boot? What are the things we need to do in Cookie Based Validation? I am new to this validation, Can anyone explain this please.
0 votes
0 answers
8 views

Apache POI - Create New layout from ZipPackagePart

I'm trying to create a new layout which will be used to create a new slide from the source slide XSLFSlideLayout layout; try { ZipPackagePart zipPackagePart = new ZipPackagePart( ...
  • 342
0 votes
0 answers
10 views

Socket client io.socket.engineio.client.EngineIOException: xhr poll error

I am trying to connect my socket client in spring boot application to my node js socket server. The node js client code is as below. socket = io('localhost:3000', { path: 'https://localhost:3000/...
-3 votes
1 answer
27 views

HTTP Status 500 – Internal Server Error | So many errors! | IntelliJ | Hibernate & Spring

I've got 500 error status on my spring & hibernate projects. I've tried to solve this problems for 2 hours and I'm still stuck and the exception are happened as follows. Exception javax.servlet....
0 votes
0 answers
9 views

SonarQube Not authorized. Spring Boot Gradle Project

I have a spring boot Gradle project. I am implementing sonarqube. For that I added sonar-project.properties file . sonar.projectKey=springboiperplate sonar.projectName=springboiperplate sonar....
  • 28
0 votes
0 answers
17 views

Create principal from JWT and set it to SecurityContext

In one system, I generated the JWT token as follows: List securityGroups = Arrays.asList("group1"); Map<String, Object> claims = Map.of("username", "user1", "...
0 votes
1 answer
18 views

When applying the annotation, it throws an error (@SpringBootApplication)

such a question. When adding the annotation @SpringBootApplication(exclude={SecurityAutoConfiguration.class}) Gives an error when building Name expected The IDE writes like this: enter image ...
0 votes
1 answer
24 views

Implement a function over an array nested inside an Hashmap to perform aggregate operation using SpEL Spring

I have a payload like String payload = "{\"array\":[{\"a\":\"b\",\"c\":10},{\"a\":\"b\",\"c\":20},{\"a\":\"b\&...
0 votes
0 answers
9 views

Transaction isolation READ_UNCOMMITED doesn't work

I have written an application using Springboot 2.0 to store books catalog in MySQL 8 database. Book object has a list of authors as there can be more than one author to the book. At the same time, ...
0 votes
0 answers
20 views

Deserialization/parsing error when sending JSON file to springboot

I built a python application to make the JSON strings to send to my springboot api, and Im getting an error about deserialization that's been a pain to try and solve. Not sure how to go about fixing ...
  • 1
0 votes
0 answers
19 views

Is it possible for one repostiory functioning as an interface to multiple collections in spring mongo repository?

i'm wondering is it possible for one mongo repository making query to multiple collections in java spring mongo repository? We know that we put @Document annotation on single entity and put that ...
0 votes
1 answer
16 views

Exception to Context Path in Spring Boot Application

I am building a Spring Boot and Thymeleaf application with the custom context path: server.servlet.context-path=/myapp So the application can be accessed as: http://localhost:8080/myapp All content ...
0 votes
0 answers
17 views

Camel route with cron scheduler healthcheck is down until cron job is triggered

I have an SFTP poller triggered with cron/quartz scheduler. I'm using Camel integrated with Spring Boot. The route is as follows; import org.apache.camel.builder.RouteBuilder; import org....
0 votes
0 answers
13 views

Unmarshaling of binary protocol buffer messages with apache camel received from apache kafka

I am developing a distributed application based on Java 11, spring boot, apache camel, apache kafka and Google protocol buffer. At the moment I am trying to send binary protocol buffer messages from ...
  • 63
0 votes
1 answer
6 views

JsonMappingException when reading the response from RestTemplate

Seeing the exception when I call the GET method in RestTemplate com.fasterxml.jackson.databind.JsonMappingException: N/A at [Source: (StringReader); line: 1, column: 13700] (through reference chain: ...
  • 372
0 votes
0 answers
24 views

How to deserialize HttpHeaders in spring boot

I am implementing a caching system using redis with spring cloud gateway which uses netty. I have my cached body model below public class CachedResponse { HttpStatus httpStatus; ...
0 votes
0 answers
21 views

Maven multi module local package not exists after compilation

I'd been working on project focused on personal finance management. The project is based on Spring Boot, and to the current moment was develop as single module project. Recently I started to move the ...
0 votes
0 answers
12 views

Spring Security : OAuth invalid grant

We need to implement a customized OAuth2 solution, where the UI client reaches the resource server through a proxy. UI calls the endpoints of the proxy, and the proxy executes the authentication with ...
0 votes
0 answers
18 views

Mono.zip() like functionality for Kafka Streams

The simplified case is as follows: Let's say I have an object with 3 fields: public class Item { private String uuid; private String value; private String category; [...] } I want to have ...
0 votes
1 answer
18 views

Cannot use a service on a Interceptor [duplicate]

I have an interceptor on spring that intercepts requisitions of the user. I want to calculate the duration of the requisition and save to the database. However spring wont autowire my bean, causing a ...
0 votes
0 answers
16 views

Is component defined with request scope lazy loaded?

A component is defined with request scope, it provides data based on HttpServletRequest object as shown below. @Component @RequestScope @Getter public class RequestDataHolder { private final Object ...
  • 436
0 votes
1 answer
23 views

refund a stripe payment as credit to the customer

I am using stripe connect to accept destination charges from customers to service providers on my website. If i refund a charge + reverse the transfer, the funds are sent back to the customer's bank ...
0 votes
0 answers
14 views

clone spring boot , maven project

hey guys i'm new in microservices developpement and there is a project that I liked to clone from github and run it in my computer but it does not work this is the link : https://github.com/...
1 vote
2 answers
20 views

What is the alternative to the authenticationManagerBean function after the WebSecurityConfigurerAdapter class has been deprecated?

In Spring Boot 2.7.4, the WebSecurityConfigurerAdapterclass which contains the authenticationManagerBean function is deprecated What is the alternative?
0 votes
1 answer
10 views

Whitelabel Error Page even though application.properties looks fine

Even though my application.properties looks fine when I go to http://localhost:8080/h2-console I still get the whitelabel error page My application.properties : server: port: 8080 Spring: h2: console: ...
  • 1
0 votes
0 answers
8 views

Spring event multicaster strange behavior with transaction event listener

I am using application events in my service and decided to go for multicaster since I can set up the error handler and get the stacktrace in the console (normally runtime exceptions are not caught and ...
  • 2,201
0 votes
0 answers
15 views

Sonarlint: Provide the parametrised type for this generic

I have installed an extension called sonarlint, I am trying to refactor my code and reduce code smells, the plugin is suggesting I do further modifications like Raw types should not be used Code ...
0 votes
0 answers
12 views

How to send rest request for only particular records in a Oracle database table using Spring Boot

I have created a simple service using Spring Boot. There is a table Message_Queue as shown in this image link - Message_Queue Table I am using oracle database. Here, msisdn is a number which is ...
0 votes
0 answers
9 views

The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

I'm trying to connect to a sql server but I get the error: The server selected TLS10 protocol version is not supported by client preferences [TLS13, TLS1] I've already tried some solutions like &...
0 votes
0 answers
4 views

How to capture Exceptions from OAuth2 client(OIDC) while retrieving user info in spring boot?

I am using ODIC authentication in my spring boot project , After successful authentication I am getting error as invalid_user_info_response , I do not see any exceptions or errors in the tomcat or log ...
0 votes
0 answers
9 views

What are the proper values to be configured for both "maxLifeTimeMS" and "maxIdleTimeMs" in mongo configurations?

I'm working on a spring boot app that integrates with mongodb cluster using a configuration string connection. Recently, I'm facing an error: Caused by: com.mongodb.MongoSocketWriteException: ...
0 votes
1 answer
11 views

Spring boot Elastic Search: Cannot set @Field Annotations while creating an Index

I'm quite new to elastic search, I'm not able to set mapping via field annotation. I'm using spring data elastic 4.3.4. I'm adding settings via @Setting annotation which is actually working. But if I ...
0 votes
1 answer
24 views

How can we convert below code without lambda expressions and streams?

How to convert below code to for each loop without using lambda expressions and streams in Java? @Override protected ResponseEntity<Object> handleMethodArgumentNotValid(...
-2 votes
0 answers
12 views

Spring vs Spring Boot topics

Can you tell me where the following topics belong to either Spring or Spring Boot? Thymeleaf, MVC, Spring JDBC, Maven, JPA, Hibernate, REST, Spring Security, ORM.
0 votes
1 answer
10 views

Spring boot - Log GET request URL for end point with multiple values

I have an end point with the following: @GetMapping(value = {"/foo", "/bar"}) public String myFunciton() { // TODO: log '/foo' or '/bar' ... } How can I log which path ...
  • 6,521
0 votes
0 answers
12 views

Execute raw sql into Spring-jpa repository [duplicate]

the problem start when i tried to exceute a sql query, these sql are build with a the name of table which arrives like parameter of method @Query(value = "SELECT * FROM :table", nativeQuery ...

15 30 50 per page
1
2 3 4 5
2568