Skip to content
Advertisement

Tag: spring

How should I consume rest web service with ssl

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

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

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:

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

Advertisement