I am supposed to write client which must fetch data from web service. I am follow this guide: https://spring.io/guides/gs/consuming-rest/ The website has https. My code: When I run my program I get this exception: It seems like I need to enable ssl. Okay, I have follow few guides and they don’t really help me. One of them: https://snmaddula.bitbucket.io/enable-https-in-spring-boot-app/ I also
Tag: spring
Getters and setters for List in Spring boot
I am creating my API in Spring Boot. I have that a product is composed of components: Here is my code: (Entity Layer) } My Question: In the controller class should I change the update method to be as follows, to have the following code, product.addProduct(myComponent) or should I have it as follows: product.setProductComponents((Component) myProduct.getProductComponents()): or is there a better
IntelliJ could not initialize class org.jetbrains.jps.builders.JpsBuildBundle
I’m using IntelliJ for a Spring Boot application made with the Spring Boot Initializr. Added are two dependency’s: Spring Web and REST Repositories. Now that I try to build the main class, I get an error saying: Could not initialize class org.jetbrains.jps.builders.JpsBuildBundle The configuration is the one given by IntelliJ and I tried updating my JDK to version 16 but
How to create a Map<String, List> property in properties file that can be injectable using Spring’s @Value
How do I create a Map<String, List<String>> property in properties file that can be injectable using Spring’s @Value? Example code snippet in Properties java file Answer Here is the answer and the example code snippet in properties file: Reference: https://stackabuse.com/the-value-annotation-in-spring/ section –> Injecting into Maps
How to use @ConfigurationProperties with Records?
Java 16 introduced Records, which help to reduce boilerplate code when writing classes that carry immutable data. When I try to use a Record as @ConfigurationProperties bean as follows I get the following error message: How can I use Records as @ConfigurationProperties? Answer Answering my own question. The above error raises from Spring Boot not being able to construct the
Kafka Consumer with JSON?
is it possible to use Kafka as getting a JSON objects from a post HTTP request putting them into topic and then sending them to Consumer(Database)? BTW here is my KafkaConfig class: Answer I assume you know how to create a post REST point with a spring project. Basically after you get the json input from your endpoint, you can
Spring Cloud Gateway Route URL pattern configuration
I’m have implemented Spring Cloud Gateway with Eureka discovery service, everything works fine but I have seen something that I don’t know how to deal with when I write the URL and if I don’t put a / at the end of the URL the gateway redirects to the app directly using its actual URL (registered in Eureka). For example:
How to use Spring Specification to filter through many to many realtionship?
I decided to create filters in my application with Spring Specification. Everything was going well but I don’t know to do filter User events. Which filter events by user login. My entities look like this: I read many subjects on stack but still don’t know to how to implement my filter logic and filter beginning looks like this: Answer I
Problems with launch spring boot jar on ubuntu server. Error starting ApplicationContext
I have configured nginx to fit my code. My code works well on Windows and now I’m trying to deploy it to Ubuntu. I run jar and it fail. Logs: My propeties: continues code: upload.path=home/kirill/uploads #properties for MailSender #smptps – Not secure connection spring.mail.host=smtp.yandex.ru #test spring.mail.username= HIDED EMAIL spring.mail.password=password spring.mail.port=465 spring.mail.protocol=smtps mail.debug=false recaptcha.secret=hided secret spring.session.jdbc.initialize-schema=always spring.session.jdbc.table-name=SPRING_SESSION hostname= HIDED HOST server.port=80
Detached entity passed to persist java spring
So i have a big error when trying to do an update method in my spring application ,the problem is regarding to the Caracter class as thats the one the seems to generate it. When i set my stuff in main and try to update an Anime object in the database the Caracter class gives me the errors presented below