Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question it is pretty long time that I am not using Java technologies and I hav…
Tag: spring
Exception when creating Spring Context with JMS Service references
We have a Swing UI client which uses an Appclient which sets up a Spring framework context with CAMEL beans for talking to remote services in an OSGi server via JMS. Here’s an example of one of the service references: Recently we added ‘camel-http’ features to the OSGi (Karaf) server to allo…
What’s the difference between return type of ResponseEntity and simple object (ex. User) in REST Spring Java?
I’m new to REST and I’m making simple REST application with users and articles. I wonder what’s the difference between two samples below: and Which one is better to use? And what’s the main difference between two of them? Answer ResponseEntity is containing the entire HTTP response tha…
Can’t register Gson TypeAdapter in Spring Boot
I have been trying to add custom serialization of my Version class in RestComponent: Json output I expect: not So I decide to use JsonSerializer and JsonDeserializer interfaces, also tried TypeAdapter. I’ve created a Gson Bean in my MVC configuration class, also tried to create GsonBuilder bean. In appl…
Spring WebClient Retry Logic with new Headers
I am trying to build a retry logic using Spring WebClient. The problem that I am trying to solve is very simple. I am calling an API endpoint to get some values. If the API returns an error with say 401 response, then I will have to make call to Token service and renew my token and use the new
Spring data rest resource inconsistently ‘discovered’ after restart
I’m using Spring Data Rest to expose rest endpoints which i can use in my user interface. However, during testing I noticed that when hitting the base rest url (http://localhost:8080/rest) , the endpoints are inconsistently exposed. I’m using the Annotation based RepositoryDetectionStrategies. I w…
Maven adding layers.idx and other spring classes automatically to the war file
I am building a war using maven (mvn clean install), the build is successful but the problem is few spring-boot related jars are getting missed in the war file(I checked using jar tf command) and instead of that many other springboot related classes and layer.idx file is getting added. How to remove these so …
spring boot REST POST method doesn’t work
I want to get the streamName parameter, which is generated when executing one method in the program where I made HTTPRequest and in response I want to get the generated hex string. I couldn’t find what is missing. This is my code in spring boot: PostResponse class: method on another program where i make…
How to use RDS environment properties attached to Elastic Beanstalk Environment – Java
I created an ElasticBeanstalk env with an RDS attached to it. The platform of the instance using Corretto 8 running on 64bit Amazon Linux 2. It says here that the RDS settings are available as environment properties like RDS_HOSTNAME and here it states that in Java, we could retrieve them using System.getenv(…
Why is my spring boot application launching with java 11 although I created it with java 16?
I started a fresh project from https://start.spring.io/ and chose java 16 as a Framework. This is my build.gradle: I have worked with java 11 and spring boot before so I had Java 11 installed.(I use IntelliJ as my Editor) In order to start my new project, I upgraded my Java version and updated my Path/Java HO…