Spring at StackOverflow

Welcome to our StackOverflow page, where we maintain a list of StackOverflow tags that our engineering team monitors and participates in. If you are a previous forum.spring.io user, please read the blog post about the change or visit the read-only archive.

Active questions on StackOverflow

0
votes
0answers
3 views

how to implement security questions in Spring Security

I have a requirement wherein, The user while registration will be filling out some security questions for recovering password. If the User while logging in fails with authentication, he will be presen
0
votes
0answers
3 views

How to set the default value for a column in a MySQL table using Liquibase changelog.yaml file and Spring Boot

I am creating a MySQL table in my Spring Boot application using Liquibase. But when I run mvn clean install I see an error where it is not able to create the table because the default value specified
1
votes
2answers
1439 views

Spring boot doesn't process commit in junit when testing hibernate repository

Hi i am trying to build up a junit test case @before setup but after processing the junit class, i found no data changed in my database and no exception throws as well. Funny thing is i can call up fr
2
votes
3answers
5159 views

Persist/commit not working in test environment with Spring JPA JUnit

I'm trying to setup a basic JPA insert test. But nothing is saved in the DB. DB is Postgresql. Hibernate is used as Persistence provider. Many thanks in advance. @Entity public class Currency {
0
votes
1answers
21 views

Does ReflectionTestUtils works only on fields of a class, not on variables defined inside a method of that class?

Does ReflectionTestUtils works only on fields of a class, not on variables defined inside a method of that class? I tried to test the fields of a class, it works perfectly fine using ReflectionTestUt
0
votes
1answers
32 views

how to fix "Failed to Load Application Context at least 1 JPA metamodel must be present"

I am new to springboot and I am trying to resolve the following run time error: java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.BeanCre
1
votes
1answers
7454 views

REST fileupload in Spring controller using multipart/form-data

Is it possible to upload file with additional data (like description etc.) with use of multipart/form-data? I'm using backbone.js in my frontend and I call REST api with it (jQuery). I don't use any v
1
votes
1answers
14 views

How to validate SM_USER header in Spring Security preauthentication for siteminder

I 'm trying to create a secure spring rest api using pre-authentication security for siteminder. I 've tried a solution where I 'm getting SM_USER and when I tested it in postman by adding new heade
1
votes
1answers
21 views

Kubernetes and RabbitMQ interactions: how to route a message to a specific replica for webservice purposes?

I'm designing a web service / API with Kubernetes, RabbitMQ, AMQP, Java Spring and TomCat with microservices. In my system, once a user request comes in, it faces the gateway microservice which pushe
4
votes
1answers
181 views

How to secure Vaadin flow application with Spring Security

I'm trying to integrate vaadin 10 with spring security (using the spring project base provided by vaadin), and I'm confused on how they interact exactly. If I go to a protected url (in this example, "
0
votes
0answers
16 views

Login in Swagger UI with Spring Boot and Spring Security

Actually, I develop a REST API with Spring Boot, and I have tried to set up Swagger on the project so I can easily navigate through the different URLs of my API. In addition I set up Spring Security.
0
votes
0answers
32 views

ResponseEntity returns null for JSON response

I have a Restcontroller class -PolicyHoldersController- that does a GET request to an API that returns a JSON object. When I hit the RestController URL, I get null, although the response status is 200
4
votes
3answers
7505 views

Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:

I am new here and I am trying to create an e-shop using Spring but I have a problem with the connection to database. I searched and found that other users asked the same thing but I cannot find the pr
0
votes
0answers
16 views

response to preflight request doesn't pass access control check: It does not have HTTP ok status

I'm trying to implement a solution for CORS problem for Spring and Angular. SO far I managed to create this: @Component @Order(Ordered.HIGHEST_PRECEDENCE) public class SimpleCORSFilter implements Fil
4
votes
2answers
407 views

How to combine Flux and ResponseEntity in Spring Webflux controllers

I use Monos with ResponseEntitys in my Webflux controllers in order to manipulate headers and other response info. For example: @GetMapping("/{userId}") fun getOneUser(@PathVariable userId: UserId):
94
votes
1answers
53738 views

Understanding spring @Configuration class

Following the question Understanding Spring @Autowired usage I wanted to create a complete knowledge base for the other option of spring wiring, the @Configuration class. Let's assume I have a spring
1
votes
1answers
11 views

How to fix "Caused by: org.apache.derby.iapi.error.StandardException: Syntax error: Encountered"

I am new to Spring Boot, I am trying to create a simple User login application in spring boot using Apache Derby as my Data-Base, unfortunately, while running my Spring Boot application I am getting b
0
votes
0answers
22 views

Spring Boot 2.1.1 Issue Accessing Tables in PostgreSQL

I am trying to add postgresql support to both my own code and OAuth2 with Spring Boot after following some examples to clean up my code. The problem is that I have to add a schema manually to my own
0
votes
0answers
24 views

How to update existing entries in @OneToMany collection?

I'm storing a collection of free proxies in database. Proxy entity consists of: IP Address Port List of sources Source is basically a website where I found this proxy information. Here's my schema
7
votes
3answers
4875 views

Spring Kafka Producer not sending to Kafka 1.0.0 (Magic v1 does not support record headers)

I am using this docker-compose setup for setting up Kafka locally: https://github.com/wurstmeister/kafka-docker/ docker-compose up works fine, creating topics via shell works fine. Now I try to conn
-1
votes
1answers
16 views

Spring boot hibernate giving exception when fetching roles set from user entity

I am having problems fetching the result set with roles from a user entity from database throw hibernate this is what I have this far: Here is the database my sql database And this is the exception i
1
votes
0answers
27 views

Spring Security User and Admin Configuration problem

I am building a web app in Spring Boot. I am have to two login pages one for admin and the other for normal users. I have created the security config like below but I have problems when I try to logi
1
votes
1answers
130 views

AWS Java SDK SQSlistener endpoint issues

I am using the AWS Java SDK as well as the spring cloud aws to utilize SES and SQS in my project. I am running into a small issue. When I try running my app I get the error: Error creating bean wi
6
votes
5answers
20731 views

WebApplicationContext doesn't autowire

I write this test class : @ContextConfiguration(locations = { "classpath:/test/BeanConfig.xml" }) public class CandidateControllerTest { @Mock(name = "candidateService") private Cand
9
votes
3answers
344 views

How to do sequence of operations and ensure one operation is complete before next one in Spring Reactor web app?

I have Spring Boot 2 web app in which I need to identify site visitor by cookie and gather page view stats. So I need to intercept every web request. The code I had to write is more complex than call
0
votes
0answers
7 views

How to get SOAPMessage from physical .xml file

I want get SoapMessage object from .xml file. Here is how i do that: private void parseSoapXml() throws XMLStreamException, IOException, SOAPException, JAXBException { SOAPMessage message =
-1
votes
0answers
19 views

Campaign monitor Api (Java Spring)

I am using Campaign monitor api. I want to get the subscribers that are in one of my list (name,email).I get a PagedResult<Subscriber> when i do Lists.active() and when i print it i get this:
0
votes
1answers
14 views

RabbitMQ config Queues Listener in YAML file

First of all I'm sorry for my English. I'm doing a high school job, and I need to set up the RabbitMQ queue name in a YAML file for my listener, and I could not. I made the application using applicati
0
votes
1answers
22 views

Spring MVC CIRCULAR VIEW PATH

I am using the spring mvc and the view is throwing the 500 error . getting the error on the console javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current
0
votes
2answers
47 views

RequestMapping issue with multiple Angular clients in Spring Boot Application

I need to handle some GET requests in order to forward to multiple Angular clients. https://example.com/web/index.html // Client 1 https://example.com/admin/index.html // Client 2 Since I don't