could someone pls help me solve this confusion? I need to display the total work hours for each worker. There are different work shifts. The most complex one, in this case, is the dawn-shift when the person works from 21:00 on a day to 7:00 on the next day, considering day offsets, i.e. on 31th October there …
Tag: spring-boot
I getting an error while i am trying to update an user and not able to show my users roles using SpringBoot
what i am trying to do after logging in, in the usersPage, i am trying to show all users with their roles and when i click on edit on one of them i get to edit_user page which i will allow me to edit users but i get an error while am doing that and in the usersPage i can’t
Spring Boot – @Slf4j Logging Behavior differs in Test and in real Application
I have a sample class like this, I have written a test case like this, When I run this test the below items gets printed to console. But when I run the printLogLevel() from application like this, The below lines gets printed to console. Below are the dependencies I have used for this testing. and this is the …
Spring Security Expression: “authenticated” vs. “isAuthenticated()”
According to the Spring Security docs, the expression to check whether a user is authenticated is isAuthenticated(). So we would do @PreAuthorize(“isAuthenticated()”), for example. However, according to the official example and confirmed by my own testing, @PreAuthorize(“authenticated”…
How to fetch data using springboot with existing mongodb collection
I have an existing mongo collection called Test collection I have created a model class for the same to fetch the data I have also created TestRepository This is my controller method But I am not able to fetch any data from mongo. I want to fetch data from the mongo collection on the basis of sequence. I have…
JAVA: Error creating bean with name; Unsatisfied dependency expressed through field
I have the following code and structure. I am getting the following error, it is very long error message. Error creating bean with name ‘departmentController’: Unsatisfied dependency expressed through field ‘departmentService’; nested exception is org.springframework.beans.factory.Unsa…
How can I show Multiple Rows in JSON
I need to show sql result in a JSON like this in a spring boot app. Class Repo Service Controller I’m getting this message on log: query did not return a unique result: 94; nested exception is >javax.persistence.NonUniqueResultException: query did not return a unique result: 94 After that, I wanna de…
Spring Boot async task stuck on shutdown
As per spring documentation for setWaitForTasksToCompleteOnShutdown Set whether to wait for scheduled tasks to complete on shutdown Does it mean that if any task is stuck on some long running process and we explicity try to stop the container, it will not be terminated untill that task is finished? Thanks for…
Jackson ObjectMapper NoSuchMethodError problem wiht SpringBoot 2.2.7 and Camel 3.11.2
I am trying to setup project with simple post route: The application should accept invoices in XML format, convert them and send them to an external system. First I just want to accept the input string and print it. Error I am getting: I am using Java 11. Any suggestions? It seams like a libraries clash. Answ…
Accept Duplicate Entry Exception for Performance Benefits?
I am currently programming a news API. To fetch news I am using java to parse XML from a List of RSS Feeds (URLs) and write them to a mysql database. I am doing this at a regular interval i.e. every 5 minutes. As these news feeds often are identical or similar to the prior time fetching I currently get