How to get Thread Dump in Spring Boot

Thread dump in java provides all the state of currently existing threads in the java process. A thread dump is useful for troubleshooting because it shows the thread’s activity. A…

Spring Boot Actuator Not Working – Troubleshoot

Spring Boot Actuator is not working because the spring boot actuator dependency is incorrect or the actuator isn’t configured properly in the application.properties file. If the spring boot starter actuator…

How to use filters in spring boot

How to use filters in spring boot – Spring Boot allows to add a filter that intercepts and filters the request and response content. In the Spring Boot application, there…

Spring Boot @WebFilter not working

Spring boot @WebFilter annotation is used to configure web filters that intercept and filter requests and responses based on the request url in the spring boot application. The @WebFilter will…

How to add multiple filters in Spring Boot

Spring Boot allows to add multiple filters to an application so that you can do multiple filter operations in the request and response before sending it to the controller class.…

Spring Boot Logger

Spring boot logging framework uses commons Logging for all internal logging and application specific logs. Log frameworks like Java Util Logging, Log4J2, and Logback are supported by the Spring Boot…

Spring Boot use different database for test

Spring Boot makes use of the database specified in the application properties file. When the application is tested with test cases, the spring boot application uses the same database configuration…

How to test JPA Repository Spring Boot

The Spring Boot JPA Repository class allows you to retrieve data from a database table.The JPA Repository is used to test database CRUD operations like insert, update, delete, and select.…

How to Log Request and Response in Spring Boot

In the production environment, logging of request and response in a spring boot application is essential for understanding the request pattern. Spring Boot actuator allows you to trace the request…

Using OAuth 2 for Secure User Authentication

OAuth 2 is a widely used open-standard authorization framework that enables secure user authentication while allowing third-party applications to access user data without having to reveal the user’s password. In…

Spring Boot @PathVariable Annotation

The annotation @PathVariable in the spring boot is used to bind the template variable in the request url to the method parameter variable in the rest controller. The spring boot…

How do I POST JSON data with Curl

To post JSON data with Curl, use the -X POST option and pass the JSON data using the -d command line parameter, with the Content-Type set to -H “Content-Type: application/json”.…

@Async Exception handling Spring Boot

The spring boot @Async annotation enables the class method to run asynchronous. The handling of the exception in the @Async annotation method is therefore complex. Spring boot supports the default…

RuntimeException: Driver claims to not accept jdbcUrl

Spring boot RuntimeException java.lang.RuntimeException: Driver claims to not accept jdbcUrl happens when an inappropriate data source url is configured to connect to a database. The database driver can accept the…

Print Hibernate SQL query string with parameter values in Spring Boot

In the spring boot application, if the hibernate log is enabled using the JPA spring boot configuration, the sql query will be printed. The value of the parameters is not logged in the hibernate log files. The default JPA spring boot configuration will enable sql queries to be logged as they are. Configuration will not enable the values of the parameter to log.If the sql query log is enabled using the hibernate logger directly, the hibernate class will log the query and query parameter values. The spring boot JPA will allow to…