Now I know how to findBySomething on root level entity. Let’s say I have a one to many relation of class -> student I can now students/search/findByName?name=Tom But it will give me Tom in all classes. Can I do something like classes/1/students/search/findByName?name=Tom It gives error right now. Ans…
Tag: spring-boot
Starting Spring Boot application (Vaadin) stuck at running ‘npm install’
My Vaadin application used to work fine, but now when I want to start it the application is stuck at running npm install: 2022-10-02 15:24:49.482 INFO 27004 — [ main] dev-updater : Running npm install to resolve and optionally download frontend dependencies. This may take a moment, please stand by……
How to read files from the sub folder of resource folder with using toURI
How to read files from the sub folder of resource folder with using URI I have some json file in resources folder like : Now I want to read this in my class which is here is what I am trying. my things are working fine but the problem what I am getting is i don’t want to use toURI
Jackson Different Deserialization vs Serlialization Method
My Spring Boot API uses camelCase, but I need to proxy some requests through my API to a 3rd party API that uses snake_case. Is it possible to configure Jackson to deserialize the 3rd party response from snake_case, then serialize it back to camelCase to my frontend? Step by step example of desired functional…
Error in getting image from Graph API in spring-boot with resttemplate
I am using the graph api: to get the particular user’s profile photo with my access token. In postman I am able to see the image using the above get call. In my spring-boot application I am using like below: I am getting below error: I have defined RestTemplate like: Could someone please help me with th…
JsonMappingException when reading the response from RestTemplate
Seeing the exception when I call the GET method in RestTemplate com.fasterxml.jackson.databind.JsonMappingException: N/A at [Source: (StringReader); line: 1, column: 13700] (through reference chain: com.homedepot.merch.meter.model.ResultSet[“issues”]->java.util.ArrayList[0]->com.homedepot.me…
Why filtering does not work with Spring Boot and MongoDB
Why filtering by import_created_at does not work? I have a Spring Boot Application and MongoDB as database. I have Mongo collection items and 2 documents there: I have entity classes for items: and and and and and And I have repository class: When I call the repo method findAllByFilters without filters (only …
How to throw custom exception when using Spring webclient exchange method?
I have created a reusable method that returns the headers, status, and body of an HTTP call using the Spring webclient’s exchange method. I want to capture the 4xx and 5xx errors in the method itself and log the response body. However, i am not able to return/throw custom exception when 4xx or 5xx error…
Spring Boot: using SpEL collection selection from YAML in @ConditionalOnExpression
I have a Spring Boot application with a YAML configuration that contains a feature list like this: I would like to use @ConditionalOnExpression to conditionally initialize beans related to those features, identifying them by keys. Since “features” property is a list, it seems I need collection sel…
Run code without transaction in transactional mehod spring
I have service like this: How can I run method2 without transaction or in new transaction? Can I run in my controller class this 2 method like this: Answer @Transactional is powered by Aspect-Oriented Programming. Therefore, processing occurs when a bean is called from another bean. You can resolve this probl…