I have a java FX basic application which has a simple Scene(a form). I have a Mysql Db and I am using Spring JPA (spring data jpa i.e repository/entities) to interact with the same. Now, since we know that javaFx has some lifecycle hooks namely: init() start() and stop(). Let’s say I want to insert data…
Tag: spring-boot
UnsatisfiedDependencyException: Error creating bean with name ‘repository.BookRepositoryTest’ in Junit Test
I am writing a junit test for spring data repository. But i can’t autowire repository interface. Program is running if i run main method and spring can detect all repositories,services,entities but if i run a test it gives this error : UnsatisfiedDependencyException: Error creating bean with name ‘…
NoClassDefFoundError for Gradle fat jar with tests Spring Boot
I need to create fat jar in Gradle project with tests where Main method is under src/test. Now I have Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/cli/CommandLineParser when I run fat jar created by ‘gradle bootJar’. My Gradle: My spring.xml: Exception:…
Spring AOP not getting invoked in spring boot 2.1.6 application
After following so many search results on google on this subject, my Aspect doesn’t work still on my spring boot application I am using spring boot version 2.1.6, which seem to have already spring aop, aspectjweaver and aspectjrt (stand to be corrected). i created an annotation, aspect component and use…
Default HikariCP connection pool starting Spring Boot application
I’m using version: 2.1.6.RELEASE form Spring Boot in my pom.xml-dependencies. To connect to my database I put following in application.properties: When checking the amount of connections in postgresql with: I see each time I start the application exactly 10 connections are made. They almost all have the…
Getting resource not found when try to return html page from controller
I am unable to render html page in springboot. Here is code… but whenever i hit http://localhost:8080/home it shows following logs Answer Avoid @RestController for MVC Based Application which has to return a view. It is mainly used for REST APIs. While @Controller can return a view More On @RestControll…
Deserialize JSON date format to ZonedDateTime using objectMapper
Background I have the following JSON (message from Kafka) I have the following (JSON schema generated) POJO (I cannot change the POJO as it is shared resource in the company) Our application is a Spring Boot application which reads the JSON message (1) from Kafka using Spring Cloud Stream and uses the POJO (2…
How to hide the password in the command “java -Djasypt.encryptor.password=somepassword -jar name.jar”
I am using Jasypt encryption and specifying the property value within ENC() in the properties file. The decryption password is sent through the command-line argument like this java -Djasypt.encryptor.password=somepassword -jar name.jar. Everything is working fine but the problem is when I search for the runni…
EnableConfigServer is not working for native location in spring boot
I am trying to configure a configuration server for all the properties in our application using @EnableConfigServer in spring boot. Please see the code below : pom.xml application.properties Copied all the property files to : /Users/Sankest/StarterProjects/MicroServices/AllConfigurations/ But when I try to ac…
org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type ‘text/xml;charset=UTF-8’ not supported for bodyType
using Java 11, SpringBoot 2, WebFlux, WebClient and Jackson trying to use Spring WebClient to consume a Web service endpoint that returns XML, content type: ‘text/xml;charset=UTF-8’ Jackson XML dependency in the project’s pom.xml: WebClient code that triggers a request to external API and bu…