i have many to many relationship between book and author, i have 3 tables: author, book and author_book. i can add data to db without a problem, but when i want to get an author or a book by its id i get an error: LazyInitialization failed to lazily … I want to use FetchType.LAZY and get the instance of
Tag: spring-boot
Deployed .war generating error: template might not exist or might not be accessible
I have a spring boot application that runs fine on localhost. I access it with http://localhost:8080/home. Now I want to deploy the application to a hosting server. Generated the .war and deployed it there. Configured http://www.customdomain.com/hostingpath/ to be the root path for the app. So that should map…
IllegalArgumentException in maven-resources-plugin during deploy goal
I am trying to build my spring-boot application using maven using below command. mvn -X -Dmaven.test.skip=true deploy During this step, maven-resources-plugin tries to copy my application.yaml file to my targetclasses folder. And this fails with an IllegalArgumentException. Relevant part of the stack trace. A…
while sending parameters to @Query function if i give like ?1 it is trying to excute like ? only
when i try send:- @Query(value = “SELECT * FROM labels where personal_ic_id=?1 and content like ‘%2%’”,nativeQuery = true) List searchByLabels(String personalIcId, String key);…
class org.springframework.security.core.userdetails.User cannot be cast
I use SpringSecurity in my web-project. When I try to login with username and password, I have this error in my stacktrace : Below, I will put classes where I think the problem comes from. Here my JwtUser.java : Here my AuthController.java : Here my UserDetailsServiceImpl.java : For information, I use java 11…
Running Acrarium by docker-compose.yaml causes HikariPool-1 – Exception during pool initialization
I’m trying to run Acrarium on my local Debian 10 machine – just to test it – by running the docker-compose up command with this compose file: The database runs successfully, but when it comes to run acrarium, I’m getting this error in terminal: HikariPool-1 – Exception during poo…
Spring boot security in kotlin with users and roles
I have to work on an application that old interns started. The backend is made with spring-boot and using Kotlin, which I’m very new to both. The backed is a RESTful API and I need to implement an authentication and authorizations to limit the access to specific users the CRUD methods. There’s bas…
Attempt to switch database target during SASL authentication
I try to setup a Mongo DB in Spring Boot project. I’ve set an uri in application.yml: But application fails to read data from repository with error: Line where error occurs (kotlin): where and The same error occurs with findAll and save operations on repository (and likely others too) Stack trace: I am …
Protect individual resources from Spring Boot via Keycloak
I’ve got a very simple Spring Boot application with resources at /repositories and /persons. Here is my build.gradle file. Here is my SecurityConfig.java file. Here is my application.yaml file. It’s all on my local machine and Keycloak and Postgres are started via docker compose. I’ve got th…
i can’t figure out which component of the spring is doing this
10.5. AuthenticationManager AuthenticationManager is the API that defines how Spring Security’s Filters perform authentication. The Authentication that is returned is then set on the SecurityContextHolder by the controller (i.e. Spring Security’s Filterss) that invoked the AuthenticationManager. If you are no…