I’m following Spring Boot Docker Tutorial from here. I got the exact result while having an internet connection. Now I need to produce the same result in an environment without an internet connection. I copied maven repositories and docker image into the new environment. I’m quite sure maven and d…
Tag: spring-boot
prevent org.springframework.messaging.MessagingException print stack trace
i am currently writing a websocket project using spring boot. And i have a websocket authentication config as this: @EnableWebSocketMessageBroker @Order(Ordered.HIGHEST_PRECEDENCE + 99) public class …
Cannot pass JWT refresh token as an argument
I’m trying to get a new access token using a refresh token in Spring Boot with OAuth2. It should be done as following: POST: url/oauth/token?grant_type=refresh_token&refresh_token=…. It works fine if I’m using InMemoryTokenStore because the token is tiny and contains only digits/letters …
Spring Retry – Exception problem and retries
How can we catch two different exceptions (ex. from .lang and .io packages) in the same block of @Retryable method. One, we return an IOException and the other we retry the method. Answer You can use the include parameter of the annotation to handle multiple various exceptions:
How to disable the Hypersistence banner when using hibernate-types-52 in Spring Boot?
I use the com.vladmihalcea:hibernate-types-52 dependency in my Spring Boot Project. And, I notice that on application boot, some large log messages were added: The hint is nice and the project sounds actually interesting, but still want to have the banner removed from my application. Answer There is a descrip…
No mapping for static-resources Spring Boot
In my Spring-Boot application, js and css files do not work, it says 404 not found. My html-page includes the following: I configured resources so: But in logs I receive: This is the location of static-sources: What am I doing wrong? Answer By default, this handler serves static content from any of /static, /…
How to disable Keep alive in SpringBoot application in docker image
We have a Web application with following technologies: Java, SpringBoot, Docker, Microservices, Jhipster. The port number for the frontend container is 80. I am trying to disable keep alive option for the frontend microservice because SSO Authentication Server requires this parameter set to be false. I tried …
An attempt was made to call a method that does not exist. STS
When i run the STS(SpringBoot) application i get the below error: The following method did not exist: The method’s class, javax.servlet.ServletContext, is available from the following locations: It was loaded from the following location: The suggestion in the ide is: Action: Correct the classpath of you…
Adding Same Site Header to JSESSIONID Spring Security
Google chrome has introduced changes that require setting the Same-Site header. In order to achieve this, I added a custom filter as follows, Following is the code for Security Configuration However, when I look at the headers received, I get this The filter adds the required fields in all the responses excep…
SpringBoot, Kafka : java.lang.NoSuchMethodError: org.apache.kafka.clients.producer.Producer.close(Ljava/time/Duration;)V
I’m using spring boot v2.2.4 and Apache Kafka in my project. Below is my pom.xml file: Below is the code which i have as part of kafka But when json message is sent to kafka queue, i’m getting below error however json message is getting reached to queue, but i want to understand why i’m gett…