Java Object to JSON String using JSON-B
JSON binding api specifies the specifications to convert java object to json string format and converting json string to java objects in spring boot. In spring boot, we see how…
Unable to load authentication plugin ‘caching_sha2_password
If you are a developer or a database administrator, you might have faced the error “Unable to load authentication plugin ‘caching_sha2_password'” while connecting to a MySQL database. This error occurs…
java.lang.AssertionError: Content type expected: but was: in Junit test case Spring Boot
We often see “Content type expected” error in unit test when testing spring boot MVC application. Spring boot test case makes a call to a web service.The Web service comes…
java.lang.AssertionError: Status expected: but was: in Junit test case Spring Boot
The Spring Boot MVC Controller returns a different HTTP status code compared to the intended HTTP status code in the Junit test case, then the Spring Boot Framework will throw…
“restartedMain” java.lang.reflect.InvocationTargetException: java.lang.AbstractMethodError
Spring boot application uses inversion of control to load all the dependency classes. Java supports the backward compatibility. If any issue occurred due to compatibility, the exception “java.lang.AbstractMethodError” will be…
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
JSTL (JSP Standard tag library) supports common java operator functions, structural tasks including conditionals statements, looping structures. It also supports tags for editing XML documents, tags for localization and internationalization,…
java.lang.IllegalArgumentException: Could not resolve placeholder ‘message’ in value “${message}”
The spring boot application failed at startup with the exception java.lang.IllegalArgumentException: Could not resolve placeholder ‘message’. This exception is due to a simple discrepancy between application.properties and the spring boot…
Using generated security password Spring Boot Security
The log “Using generated security password:” appears in the startup of the spring boot application. This log is due to default security configuration. This can be disabled, removed or customized…
There is no PasswordEncoder mapped for the id “null”
The exception “java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null”” occurs if the spring boot application is enabled with security feature and password encoder is not configured for…
There was an unexpected error (type=Internal Server Error, status=500).
When a restful web service call is made to a Spring Boot MVC application, It shows error “Whitelabel Error Page – There was an unexpected error (type=Internal Server Error, status=500).”…
At least one mapping is required (i.e. authorizeRequests().anyRequest().authenticated())
Spring Boot security is one of the most requested features in the application. Security controls the user access page on the basis of the configured roles. In this post, we…
Whitelabel Error Page There was an unexpected error (type=Forbidden, status=403). Access Denied
The Access denied exception There was an unexpected error (type=Forbidden, status=403). Access Denied is a common exception seen in the browser when you access the url of the spring boot…
IllegalStateException: permitAll only works with HttpSecurity.authorizeRequests()
In spring boot application, The exception “IllegalStateException: permitAll only works with HttpSecurity.authorizeRequests()” is thrown if the spring security is configured. In this post, we will see how this exception is…
Logout is not working in Spring Boot Security CSRF enabled
IIn the spring boot application, if the security module is configured with CSRF – Cross-Site Request Forgery, all requests are verified for a CSRF attack. In this case, the logout…
Can’t login to my custom login page in Spring Boot Security
In the spring boot security application, when we try to login to the page. It redirects back to the login page. It doesn’t matter how many times we log in,…
SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method:
Spring boot Exception SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: is thrown if an exception is thrown from the @Async annotation method. This error is due to either to…
java.util.concurrent.RejectedExecutionException: rejected from java.util.concurrent.ThreadPoolExecutor
The java.util.concurrent.RejectedExecutionException: rejected from java.util.concurrent.ThreadPoolExecutor error occurs when the thread pool queue is full and no further threads can be created in spring boot. If the ThreadPoolTaskExecutor could not create…
How to access a value defined in the application.properties file in Spring Boot
Spring boot enables to access a value defined in the application.properties file in different ways, such as using the @Value annotation, using System environment object, Using the @ConfigurationProperties Annotation, and…