Questions tagged [spring]
The Spring Framework is an open-source framework for application development on the Java platform. At its core is rich support for component-based architectures, and it currently has over twenty highly integrated modules.
209,990
questions
0
votes
0
answers
17
views
How do microservices communicate with each other or exchange data in Spring Boot?
I am implementing my microservices system with eureka and gateway with Java spring boot.
Currently I have 2 services: Product and User. In the products table at Product service, the field createdBy is ...
0
votes
0
answers
9
views
Spring Shell: Execute multiple commands in one line
I have two commands in my Spring Shell application:
@ShellComponent
public class HelloCommand {
@ShellMethod(value = "hello")
public void hello(){
System.out.println("...
-2
votes
1
answer
15
views
IDE is not recognizing the parseclaimsjws
mycode
Can someone help me please ?
i dont know what to do
static public Authentication obterAutenticacao(HttpServletRequest request){
String token = request.getHeader("Authorization&...
0
votes
0
answers
19
views
Multi-tenant-Architecture and Second level caching issues (spring, hibernate 5.4.21.Final , multi-tenancy, caching ehcache )
I have implemented multi-tenant datasource to route between the schemas at runtime,our requirements are as follow single instance single database with multiple identical schemas
I will determine the ...
-1
votes
0
answers
28
views
Getting a Caused by: jakarta.persistence.TransactionRequiredException: Executing an update/delete query
I am encountering an issue while trying to execute a DELETE query using Hibernate in my Spring Boot application. It deems the delete operation in not part of the Transaction. The error message I'm ...
0
votes
0
answers
12
views
@Autowired Bean with @Async got null field
I have Class A, it looks like this:
@Component
@Async
public class A{
private Data data = new Data();
public void asyncMethod(){
do something
}
}
And when I try to get it ...
1
vote
0
answers
20
views
Injected dependencies of Controller are sometimes null when using @SchemaMapping
I have a problem on a SpringBoot (3.2.0) application that uses GraphQL with spring-boot-starter-graphql.
I have several annotated controllers that contain some @SchemaMapping, @QueryMapping and @...
-2
votes
0
answers
38
views
Spring boot 3.2.0 - No static resource
I try upgrade spring boot to 3.2.0 and spring cloud 2023.0.0.
when I run up my project on kubernetes got this error.
I upgrade from spring boot 3.1.5 -> 3.2.0, and spring cloud 2022.0.4 -> 2023....
1
vote
1
answer
27
views
Spring @Retryable annotation not working in spring boot application
I'm trying to implement a retry mechanism using spring retry. However, retries are not working.
I have added @EnableRetry annotation in the main class
Below is the code of the service class. I want to ...
0
votes
0
answers
9
views
Liquibase with Spring Boot fails the whole application if it has failed changeset precondition with onFail==MARK_RAN/CONTINUE/etc
Briefly: if precodition of changeset fails and there is onFail property != "WARN" - i got
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase'
...
0
votes
0
answers
18
views
Why do I get NoSuchFileException when using multipartFile @Async in java spring boot?
I can use multipartFile.getInputStream() with the scanner without using @Async, but when I get the file with the multipartFile.getInputStream() stream , it says the file path incorrectly(with @Async).
...
0
votes
0
answers
16
views
Changing role prefix in Spring Security 6
I am new to java and spring security. In spring security 6, lot of classes and interfaces have been deprecated.
I understand in Spring Security 6 we need to use AuthorizationManager however I am not ...
0
votes
0
answers
28
views
How to get Jackson ObjectMapper to work with xjc generated classes containing Jakarta annotations?
Here's my case,
I've generated some source files from some XSD & WSDL files. The generated sources have classes & attributes annotated with Jakarta annotations. There are 3 layers in my ...
0
votes
0
answers
7
views
Spring Web Url Changes During Request Processing
I am trying to understand the processing of a web requests with Spring Boot Web Application. I am making a request like "/test/", and it I look in the tomcat access log I see the URL as &...
-1
votes
0
answers
18
views
How to mitigate privilege escalation in Spring Boot Java using JWT tokens
If there are two types or roles - Admin and Normal user, when we copy the admin JWT token and paste it in the normal user token section in the browser, the normal user is being treated as admin with ...
1
vote
0
answers
14
views
High CPU Utilization on EC2 of a Spring MVC micro service with authentication disabled
One of the services is giving high CPU utilization.
I analysed the thread dump and found the following stacktrace to be the culprit of the problem. But I am not able to identify how to fix it.
This is ...
0
votes
0
answers
41
views
How can I use programmatically read properties from a .msi file?
I have a Spring Boot application where the client can upload .msi files. When the client does so, I need to access some information that the .msi file holds. For example the icon, application name, ...
1
vote
0
answers
29
views
Spring boot context comes as null when implementing ImportBeanDefinitionRegistrar
I have created a Context class to store information about beans i want to create at runtime.
@Component
public class Context {
private final Map<String, Properties> annotatedMap;
...
-1
votes
0
answers
32
views
Async problem with multipartfilereader Java spring [closed]
There is a situation where I want Async to work in my java spring project. I get a timeout, but the process continues in the background and then it sends an e-mail to my user. I thought I'd use @Async,...
0
votes
0
answers
14
views
Could not Set JTA transaction manager default timeout
I am using spring application, below is my code.
import org.springframework.transaction.jta.JtaTransactionManager;
@ComponentScan(basePackages = "com.abc.xyz")
public class MyConfig
{
@...
0
votes
1
answer
30
views
How to pass a list of Object in Webclient get request call
How to send List object as parameter to get controller
EX:
@GetMapping("/demo")
public List<Student> m1(List<Employee> account)
{
}
public Employee
{
String id;
String name;
}...
-2
votes
1
answer
31
views
In Spring Security allowing some endpoints without authentication
I am working on spring security, I want some controller endpoints should need authentication, some should not. I have created one security config. and tried
@Bean
public SecurityConfigurerAdapter&...
0
votes
0
answers
14
views
How to make Error look specific in first microservice that receives it from the first microservice and the rest of microservices to just see 500?
I have a chain of microservices in Spring Boot 'A -> B -> C -> D' (A calls B, B calls C and so on) and when C calls D I want the exception in C microservice logs that it receives from D to ...
0
votes
0
answers
19
views
Translating a string to warehouse object in hotfolder
We are currently receiving a CSV outside our organization. This is to update the table StockLevel. When we receive the CSV, instead of the actual warehouse code, we receive a dealer code in 2nd column....
0
votes
1
answer
17
views
Implementing User Registration in Keycloak with Flutter and React Frontends
I'm working on a project that involves a Flutter frontend, a React frontend, and a Spring Boot backend. I aim to handle authentication using Keycloak. However, I've encountered an issue: I can't seem ...
0
votes
0
answers
23
views
Spring JavaMailSender not sending email via server
I have a project created in Tomcat 7 / jdk1.7.0_21 / Spring Framework 4.0.1. I recently reinstalled it using Tomcat 8.0.3 / openjdk1.8.0_382 on Ubuntu 22.04. Everything works fine, except the email.
I ...
1
vote
0
answers
39
views
Postgres JSONB to Oralce BLOB via Java
Getting given below error while loading Postgres JSONB data into Oracle BLOG data type column.
SQL state [99999]; error code [17004]; Invalid column type; nested exception is java.sql.SQLException: ...
0
votes
1
answer
44
views
Multiple Kafka Producers in Spring Boot
I have a use case which requires me to have multiple Kafka Producers (based on the configuration). i.e., if my configuration has 3 tenants who want to receive data, I want to spin up 3 producers (all ...
0
votes
0
answers
24
views
How to invoke a method, annotated by @Transactional annotation from non-transactional method correct way in Spring Boot?
Here is sample code of Spring Boot with @Transactional annotation. My Server is WildFly. I am using JTA transaction which is provided by WildFly module. The database connection of my application and ...
0
votes
0
answers
34
views
Spring boot - write to IBM Mq multi-thread
I have a Spring Boot app that uses multithreading (by the @Async annotation with an associated TaskPoolExecutor). On each thread I would like to write a message to a IBM MQ queue - the same one.
I ...
0
votes
1
answer
44
views
How to use Spring Boot 3.2.0 with MySQL database and JpaRepository @Query has boolean comparison
I am planning to migrate spring boot from 2.7.1 to 3.2.0.
It's my model class:
@Entity
@Table(name = "tutorials")
public class Tutorial {
@Id
@GeneratedValue(strategy = ...
0
votes
0
answers
19
views
SdkClientException: Multiple HTTP implementations were found on the classpath
i've been building sqs consumer using spring aws cloud and encountering contextLoad() test case failure during gradle build. i'm using the following dependency version as recommended here.
java 17
...
0
votes
1
answer
22
views
Azure Service Bus - Token issuer is invalid
I am trying to create a simple SpringBoot application that receives message from Service Bus, but when I try to connect with DefaultAzureCredentialBuilder I am getting this error:
Failed to create ...
0
votes
0
answers
35
views
Elastic beanstalk deployment timeout error
Cant upload spring boot war file into environment.
Error looks like this:
I tried to change timeout while creation of app like this:
It doesnt help. File uploading continuous approximately 10-20 ...
-1
votes
0
answers
24
views
Automatic data completion in the form (HTML,CSS, SPRING)
I'm developing an application in Spring and adding a view with simple HTML, CSS, and Thymeleaf. I would like to know the easiest way to automatically populate fields in the HTML view based on certain ...
0
votes
1
answer
35
views
Tomcat 10 throws FileNotFoundException error when trying to load a resource from the classpath inside a ForkJoinPool
I want to share an issue that started to happen after upgrading from Java 8, Tomcat 8, and Spring Boot 2 to Java 17, Tomcat 10, and Spring Boot 3.
The issue is that now we can no longer load some font ...
0
votes
1
answer
28
views
Extra columns in table used in @JoinTable annotation
I'm creating a REST API using Spring Boot and Hibernate.
I have two tables, let's call them table Foo and table Bar. They have an 1-N association that is mapped through a third table, let's call it ...
0
votes
0
answers
16
views
spring cloud gateway and keycloak CORS error when using oauth2-resource-server
I am using spring boot 3.0.2 and spring cloud gateway. also, I using spring-boot-starter-oauth2-resource-server to obtain and check jwt token on Keycloak server for security.
my build.gradle file like ...
0
votes
0
answers
15
views
How can I use Spring repositories and Jooq transactions together?
I am using Jooq for the persistence layer.
Also, I use @Repository annotated Spring classes to incapsulate logic of accessing to DB.
A typical repo gets the injected DSL object and looks like
@...
-1
votes
0
answers
15
views
How migrate users to keycloak (java, spring)? [closed]
I need to move users from the database user_ table to Keycloak. How can this be done automatically so as not to be created a user manually? I use spring, java and jmix (jmix is optional)
Nothing tried,...
-1
votes
0
answers
33
views
Configuring the WebClient Spring boot 3 - spring security
I migrate my batch project in spring boot 2.7.X to spring boot 3.2.0 and i have a problem to migrate this part of my code :
@Bean
@SuppressWarnings("all")
public WebClient webClient(...
-1
votes
0
answers
23
views
I faced this problem while running the spring boot project on eclipse
Exception in thread "main" java.lang.NoSuchMethodError: 'org.springframework.core.io.support.SpringFactoriesLoader org.springframework.core.io.support.SpringFactoriesLoader....
0
votes
1
answer
20
views
Using Hibernate-Reactive and together R2DBC in one project
I am currently working on a project using Spring-Webflux and R2DBC. I am using an OracleDB 19c and corresponding drivers for R2DBC. Since Hibernate went reactive I want to try it in the existing ...
-1
votes
0
answers
30
views
OpenApi throws java.lang.NoClassDefFoundError: jakarta/validation/constraints/Min] with root cause
I've created spring boot application (spring-boot 3.2.0). In my controller I've got simple controller
@RestController
@RequestMapping(value = "/user")
@AllArgsConstructor
public class ...
0
votes
1
answer
53
views
Spring Cloud Gateway Server MVC- Can we use spring mvc with spring cloud gateway
what is the purpose of Spring Cloud Gateway Server MVC.
Can it be use on the place of spring cloud gateway reactive.
If yes,Can someone provide me better example.
here is document I am refering to
...
-1
votes
0
answers
18
views
JPA criteria for a legacy DB
I'm currently working with a complex database where we have a concept of an 'structured table,' which is essentially a table of tables. For tables that would have only two columns like 'id' and '...
0
votes
0
answers
24
views
How to check for null for a key in@Cacheable?
Is there a way to check if marketCoverage is null before calling market.getValue() in statement mentioned below ?
@Cacheable(value = "issuerCache",key="#zip + #county + #marketCoverage....
0
votes
0
answers
32
views
Solve checkmarx Spring ModelView Injection
I have to solve this so called spring modelview injection in an old Spring MVC 2.5 application.
Checkmarx says
"The input processed by showForm in MyClass.java in line 112 is used to construct a ...
0
votes
0
answers
16
views
Thymeleaf SpEL null on object that is not supposed to be null
I'm currently upgrading the dependencies on a company project, and thymeleaf ended up being one of the dependencies I had to upgrade, from thymeleaf2 to thymeleaf3.
Right now, a lot of old thymeleaf ...
0
votes
1
answer
36
views
The problem with error 403 (Forbidden) before processing the request in Dispatcher Servlet Spring Security
I have a problem in my application using Spring Security. In case of any error, before the request gets to the Dispatcher Servlet, the error status 403 (Forbidden) is returned.
The problem occurs even ...