i have a case like in my form (front end), i can fill personal data (name, address, DOB) and then i can attach multiple image. In my spring boot controller : My model wrapper : Front end (React) Code : With above example, i always encounter errors. like : java.io.IOException: Stream closed and zero attachment…
Tag: spring-boot
Using Spring data JPA EntityGraph with LAZY load mode for NamedAttributeNode field
I am facing with 2 problems: N + 1 query and Out Of Memory (OOM). I solved OOM by paging and lazy loading: But when I use lazy loading, N + 1 query happened. So I try to use EntityGraph as https://www.baeldung.com/spring-data-jpa-named-entity-graphs. But as my researches and local test, EntityGraph always do …
Spring Boot REST API using LDAP authentication
So I’m trying to build a REST API that will use LDAP authentication. Basically, when my login endpoint is consumed, I want it to detect credentials using httpBasic authentication and then use those credentials against my LDAP server. I also want to take into account user roles, protecting endpoints so t…
Deploying spring boot application to heroku – error message “No web processes running”
I created a spring boot web application (in IntelliJ IDEA), which runs locally without problems. I then built an artifact (Build -> Build Artifacts… -> my_app:jar -> Build), which created a jar file in directory “out”. I tried to deploy the app to heroku following exactly the steps …
Why has javax.persistence-api been replaced by jakarta.persistence-api in spring data jpa starter?
I’ve recently started to learn spring boot, data jpa. As I can see from this, the spring boot data jpa starter uses jakarta.persistence-api instead of javax.persistence-api: What is the differences between jakarta.persistence-api and javax.persistence-api? What is the reason of this replacement? Answer …
How to deploy Spring Boot application in Google Cloud Compute Engine?
I am a new to Google Cloud platform. I want to deploy my Spring Boot project in Compute Engine because deploying in App Engine costs more than the Compute Engine. There are a lot of videos/articles are available in YouTube/Websites for deploying in App Engine but I did not find any tutorial on deploying Sprin…
How to store JSON file as a JSON datatype in mysql using Hibernate / Spring boot?
I’ve tried several ways of storing a json file in a database but it ends up creating different columns for each entry. I want to store it as a “json” type in a single column. Is it possible? My json file. users.json It’s a spring-boot application and I’ve the relevant controllers…
Swagger Codegen basePath is being ignored
I’m trying to generate some web services definitions using Swagger Codegen » 2.2.1 All configs are working and the classes are generate correctly by my .yaml definitions. Why the property basePath is being ignored? My @RestController generate using only paths definition: Expected (using basePath and pat…
Geting list of protobuf message objects from the SpringBoot
I want to get a list of protobuf message objects from the Spring boot app. I did manage to get a single protobuf message object from the app but getting a list of them throws exception. My code (simplified). tl;dr create Spring boot app generate class from proto file try return List of generated class objects…
Is there way to use @Scheduled together with Duration string like 15s and 5m?
I have following annotation in my code At this case I have to have properties like this Propery file looks unreadable because I have calculate value to miliseconds. Is there way to pass value like 5m or 30s there ? Answer As far as I know, you can’t do it directly. However, Spring boot configuration pro…