Questions tagged [spring-boot-2]
111 questions
1
vote
0 answers
@Embedded Audit was working with spring boot 1.4 but now not working after upgrade to spring boot 2.1.x
public interface EAuditable {
public static interface Update{
public EUpdateInfo getUpdateInfo();
public void setUpdateInfo(EUpdateInfo updateInfo);
}
public static interface Create{
public ECreateInfo…

satyabrata mohapatra
- 11
- 1
1
vote
1 answer
How to integrate spring profiles in Spring Boot 2.4+ application.properties
My current spring boot 2.3 and below config files are
application.properties
application-dev.properties
application-qa.properties
application-prod.properties
application-local.properties
I have to include the profile onlyLocal in my local profile…

Hackerman
- 1,289
- 1
- 14
- 29
1
vote
0 answers
MDC log with Reactor using logOnNext
I need to show context values in logs of the whole application.
I tried to do it in this method: "searchStudents" but I got not success. It seems when do step ".doOnComplete()" the subscriberContext is lost and I need and alternative.
Have somebody…

egroque
- 57
- 5
1
vote
2 answers
Swagger UI page is found for Spring Boot 2
Using Spring Boot 2.3.1.
Here is a snippet from pom:
io.springfox
springfox-swagger2
${swagger-version}
…

catch23
- 17,519
- 42
- 144
- 217
1
vote
1 answer
springboot2 actuator endpoint not supporting Server Sent Event(SSE)
I am trying to expose few metrics as a stream using SSE. I am able to consume the SSE event from the restController but when I added custom actuator endpoint , it just closes the connection right way.
@Component
@Endpoint(id = "test")
public class…

Vijay Ram
- 285
- 2
- 15
1
vote
1 answer
Is there a common code to change the date format(timestamp) to Number format
I am using SpringBoot 2.2. date format is "validFrom": "2013-12-31T18:30:00.000+0000"
But I want in number format (like 1411471800000).
In my entity I included the below code snippet which worked in Number…

Kalyan N
- 31
- 2
1
vote
1 answer
Mockito "when" method does not match lambda argument on RestTemplateBuilder requestFactory in spring boot 2
I am having an issue when trying to mock restTemplateBuilder:
private RestTemplate restTemplate() {
HttpClient client = HttpClients.custom().build();
return restTemplateBuilder.
requestFactory(() -> new…

Dariusz Urbanek
- 166
- 1
- 11
1
vote
2 answers
How do I pre-load my Spring Boot integration test with a user from my H2 database?
I'm using Spring Boot 2.1. I'm also using the H2 in memory database. I have created this file at src/test/resources/data.sql:
insert into roles (id, name) values ('1be4965cb4f311eaa2b76a0000c30600', 'USER');
insert into roles (id, name) values…

satish
- 703
- 5
- 23
- 52
1
vote
2 answers
In @SpringBootTest, how do I get a fasterxml objectMapper to include a field from my model?
I'm using Spring Boot 2.1 with Java 11. I have annotated my User model with fasterxml annotations so that my password can be accepted for POST requests, but not returned for other REST requests ...
@Data
@Entity
@Table(name = "Users")
public class…

satish
- 703
- 5
- 23
- 52
1
vote
1 answer
In Spring Boot with JPA, how do I configure my application so that a date column auto-populates with the current time of it's creation?
I'm using Spring Boot 2 with Java 11. I have created the following JPA entity ...
@Entity
@Table(name = "Mailings")
public class Mailing {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private UUID id;
@ManyToOne
…

satish
- 703
- 5
- 23
- 52
1
vote
1 answer
Jolokia endpoint is not exposed through spring boot actuator in open shift
I have a camel application which is running in spring boot 2 and camel routes are visualized through hawtio. And all actuator endpoints are exposed including jolokia endpoint
this application is completely working in local and
when I try to access…

Ravikumar
- 413
- 1
- 7
- 18
1
vote
0 answers
JPA JpaRepository child record has parent id instead of entity record if parent already fetched
I'm still grasping JPA concepts and can't seem to find the answer to my question anywhere!
Assume
Both classes are annotated with @GeneratedValue(strategy = GenerationType.IDENTITY), There are all getters and setters.
Parent{
....
…

Olivier M.
- 51
- 6
1
vote
1 answer
Spring Boot2 Undertow Same Site - HttpHandler Customization - Help wanted
I ran across this url which suggests that an Http Handler can be added(Example is in Spring 1.x). https://lists.jboss.org/pipermail/undertow-dev/2017-March/001938.html
I have tried adding the following code - it does not appear to be called unless…

goldel777
- 21
- 2
1
vote
1 answer
I18n for custom error messages into JPA entity
I looking to understand how to internationalize JPA entity error message. I understand how its work into a controller using autowired MessageSource but in my case I want to do this into a JPA entity. I'm not intresting about using the same way as…

BeRoots
- 81
- 12
1
vote
2 answers
Error on CrudRepository. Whitelabel Error Page
I have an error that I cannot resolve in Spring boot 2.2.2 with my repository. This is a simple CRUD application using spring boot 2 with JPA MySQL and Web-Starter.
The error is:
Whitelabel Error Page
This application has no explicit mapping for…

BeRoots
- 81
- 12