I have problem understanding how to connect 3 tables with spring-boot / hibernate. Tables are: Users, Technologies, Categories Every user has all of the 10 categories but inside this categories they can save one or more technologies. Each technology can be listed in several different categories. I have a code…
Tag: spring-boot
Spring is trying to subclass a record component when aop is present
I have a spring boot application in which I make use of aspects. Recently, I tried converting my @ConfigurationProperties classes to java records, but it fails with “Cannot subclass final class {..}Properties”. It seems spring is trying to make cglib proxies for my records, which obviously fail. I…
Spring Boot session scoped bean
I am trying to understand how the Session scoped bean work and have tried the example from here. HelloMessageGenerator.java HelloMessageBean.java HelloMessageController.java When I go to http://localhost:8080/scopes/session I get an error. scopesExample.html The error I am getting is as if the mapping would n…
SortedSet + Hibernate’s @SortNatural + Comparable not sorting elements when fetch from DB
I know similar questions have been asked before, I looked through them but still can’t figure out why in particulary this case sorting is not working. I have 2 Entities – Category and Transaction with relations OneToMany. Inside one category there can be many transactions and One transaction belon…
Spring AOP and AspectJ on same method
I have a question about using aspectJ and spring aop method intercepting. I created 2 annotations: @AJTest and @SAOPTest. registered it and other and register it and added it to my method in controller Application class but when i call it by http://localhost:8080/test?firstParam=test&secondParam=2 i can&#…
Application build is successful but getting error: ‘no main manifest attribute, in app.jar’ while running the image
I am trying to deploy my spring boot application on a docker. I have created a docker file as follows. The docker file builds fine but when I run the image it throws the following error: Please note that my application runs on JDK 11, maven build and already added dependency for spring-boot-maven-plugin. I co…
Jackson module not registered after update from Spring Boot 2.4.x to 2.5.x [duplicate]
This question already has answers here: Spring Boot 2.5.0 and InvalidDefinitionException: Java 8 date/time type `java.time.Instant` not supported by default (4 answers) Closed 6 months ago. After updating my spring-boot-starter-parent version from 2.4.8 to 2.5.4, I started having this error with jackson seria…
is it possible to make swagger do not show the reference project api
Recently I found my swagger UI document shows so much api entry point. Finally I found that the document also shows other project entry point. For example, Spring Boot project A imported Spring Boot project B and C, but the Spring Boot project A shows A + B + C’s api entry point in project A’s swa…
Spring boot how to use @PostConstruct correctly
Spring boot 2.5.4 I used @PostConstruct for the very first time in my service class. As following:- This method is called as soon as app launched. That is my requirements to process all file as soon as the app starts. I have controller as following:- My app starts on port 8080 and no exception at all. But whe…
Uploading files to S3 in Multithreading
I’m uploading files to s3 using the s3 AWS client in my spring application, but sometimes I’m getting the error, So as a solution to this I used the following approach and it worked for now. I have created this as a Spring Bean. But I am using this in a multithreading environment. So there will ma…