So basically I have my rootFolderId in my application.properties and I need to get it in the Controller and use it in @RequestParam like : but I get the problem “Attribute value must be constant” .Is there any way to make it work ? Answer You can use property replacement in the @RequestParam field…
Tag: spring-boot
OAuth issue in API gateway
I am facing the OAuth issue, details are below: I am having two microservices: registration-service(https://github.com/choudharylakshyaveer/registration-service) student-service(https://github.com/choudharylakshyaveer/student-service) For these two I have added : cloud-config-server(https://github.com/choudha…
Spring Boot. Forward on RestController
I am implementing a mechanism for replacing short links. I need to forwarded request to another controller. I found examples how to do it in spring on models, but I don’t understand how to do it in RestControllers Example what i found (use models) Or maybe I’m looking in the wrong direction and I …
Spring repository : Junit test succeeds on custom delete even when @Transactional is missing
I have a Spring repository that has a method like this : When testing this method in a Junit Test, it does work as intended. However, the delete does not work on our production DB. For it to work on the production DB, we had to add the @Transactional annotation to the method in the repository This is an issue
Spring Boot: Custom exception adds prefix to the exception message
In a Spring Boot app, I created a custom GlobalExceptionHandler and add the following method to handle ConstraintViolationException for invalid file type during upload process: My buildErrorResponse works correctly and build proper responses for other handle methods. However, It adds “uploadFile.file:&#…
How to replace CXF base url in WSDLs
I’m using Apache CXF and Spring Boot to expose SOAP endpoints. Here’s the config: You can see that I expose one endpoint. It’s accessible at https://localhost:8081/daas/activate/activateGateway?wsdl: But this location=”https://localhost:8081/daas/activate/activateGateway is not valid b…
c.e.security.jwt.AuthEntryPointJwt : Unauthorized error: Full authentication is required to access this resource
application.properties config log Go to URL http://localhost:8088/swagger-ui/index.html How to fix it? Answer Your configuration is mostly correct, your swagger page loads properly except that when it tries to retrieve the swagger config and api-docs via its ajax call it fails to do so because it’s unde…
Batch update returned unexpected row count from update JAVA
When i try to add user throws next exception: This is my entity: } This is my service: Mapper for reg user: I found some strange things like: when i dont set field ROLE in mapper i dont recive this excep; i create my DB with dates, and when i have it’s with nanos in db, i dont recive exception,
exception is java.lang.NoClassDefFoundError: liquibase/Scope
I have multimodule project using Spring Boot and liquibase. If i run it usring mvn spring-boot:run it works, but if i run it using intellej i get this error: Module info of my module: Any ideas how to fix it? I will aprecciate it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Answer My guess is that your Liquibase fil…
Set the database current timestamp while inserting using JOOQ
I am using the following code segment to do the insertion using JOOQ’s UpdatableRecord. When setting the AcceptedAt data, I want to use the database’s current timestamp instead of passing the JVM timestamp. Is there any way to do that in JOOQ? Answer UpdatableRecord.store() can only set Field<T…