I got trouble with spring-boot-maven-plugin build process. I just want to build excutable “layered” jar file for optimizing docker image. As document said this build process will produce layered jar by default https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/. Here is apart of my pom.xml file I used spring boot 2.5.5, maven 3.6.3 Some steps produce: mvn clean package jar -tf target/[excutableJarFile].jar This filesystem of excutableJarFile
Tag: spring-boot
Spring Boot, using oracle-ldap url through ssh tunnel on local machine
There are 3 machines: local -> some remote server -> oracle db server (via ldap) I want to set up datasource connection (in my spring boot app) to the oracle db. There is no direct connectivity between local machine and the one with oracle db. So, i’m using the ssh tunnel through remote server: ssh -L 127.0.0.1:8081:some.ldap.host:389 user@remote.server.host In application.yml
JPA repository return one item from db but there are multiple item in the db
I have the following function in my repository When I use this function in the controller I got back one User. For example, if I have a String “John” and I call the repo function with that string I got back “John Doe” but I also have “John Doe Jr” in the db and I need him too. Why I
How to customize the internal server error message (error code : 500)
Consider a scenario where I want to create a record in database with the already existing ID. By doing this, we get “500-internal server error”. But I want to customize the message returned to “Id already exist, Cannot create record”. Below is the my sample existing code: Controller class : Service class : Postman Output : As in the above
How can i fetch property from application-test.properties file in Java class?
I have set the variable “spring.profiles.active” in my environment to “test” and I have below file in my src/main/resources. application-test.properties It has one property “machine” I want to access this property in one of my Java based class. PropertiesConfig class: But while running this as a Spring boot application in Eclipse. I am getting below error: What am I missing?
SpringBootTest for an arbitrary ApplicationConfiguration class to test the reading of the application.yml file
I would like to learn how to write a SpringBootTest for an existing ApplicationConfiguration class for the purpose of testing the functionality of reading the application.yml file. I would be happy with java or groovy. I am not able to share the existing ApplicationConfiguration class, so I would gladly accept any example offered that starts with an existing ApplicationConfiguration that
Spring with Jackson set JsonAutoDetect globally
In my spring boot web application, I want to serialize many different classes to JSON when I return them from the function of a request mapping. These classes only contain private fields without getters. In order for Jackson to serialize these private fields I can annotate all those classes with the following annotation, which works perfectly fine as expected. But
Java spring userRegister creates two database entries instead of one
As above this creates two database entries in user table. The process should be following: a new user enters their email and password -> saved in login table user confirm Email address -> entry in user table with username (email) and first&second name should be null at first. For second the code would be like that (working) is returning {“answer”:”done”,”username”:null}
Cannot resolve symbol, but the dependency is in local repo
I’ve been reading all similar problems with maven but I cannot seem to be able to fix it. The issue is the classic “Cannot resolve symbol ‘pippo'”, in which case pippo is part of import com.pippo.device.manager.data.model.Device; This class Device comes from this artifact that I have in my local repo Evidence that it is in the local repository and evidence
How can i solve [Received fatal alert: bad_certificate]?
I’ve created two servers locally, and I’m going to apply a mutual authentication to their communication. I just don’t know what the problem is. I lack understanding of this mechanism, but I also lack understanding of the server itself. Create each key store Export to X.509 to register certificate in Truststore. Register each other’s certificates in Truststore. server’s application.properties client’s