I’ve created simple demo for Spring boot and Thymeleaf, but I cannot open index page. Controller code: Having index template in /src/main/resources/templates/index.html Having application.properties: server.port=9095 And going to the address http://localhost:9095/ And getting error: Spring boot class is…
Tag: spring-boot
java model mock response json
I am creating a Rest service which calls an external service. I have this problem: the external service I call responds in two ways depending on the case of Success or Failed. This is json: Well I created 3 simple classes: class XXX… private String result, status; …. getter & setter class Resp…
How to retrieve the URL of a RequestEntity obtained from RequestEntity.post(String, Object…)
I’m using Spring Boot 2.6.1 with Spring Web MVC, and in my controller, I want to get the received RequestEntity instead of only the request body, because I have to use information such as the URL. When I want to test my controller, I build a RequestEntity with the following code: Now, I don’t know…
Error creating entityManagerFactory.Unable building Hibernate SessionF.SchemaManagementException:Export identifier[new_user]encountered more than once
My controller class – My JpaRepository extended interface – My Pojo class – And , the errors which it is giving is – org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframe…
Update 1 or multiple specific field MongoDB using Spring boot WebFlux,Spring Data MongoDB Reactive and ReactiveMongoRepository
I’m newbie with java. I tried to implement update method for my API. I want to update some field of my data. Here is my data class: My service interface: And implement for services: My Controller: And Task Repository: My data in DB: My request body: I expected: But it responsed: It update my missing val…
Override Hysterix Logging
I am trying to understand the logs generated by SpringBoot before and after implementing Hysterix Circuit Breaker Before Hystrix the logs looked like, After implementing Hystrix the logs looks like, So, how did http-nio-8080-exec-2 get replaced with hystrix-OrchestratorController-1, and why it’s not sho…
gradle publishing project-version-PLAIN.war file instead of project-version.war
When I run “gradle build”, it generates a build/libs/project-version.war file which is able to run by itself with “java -jar” command. But when I run “gradle artifactoryPublish”, it saves on the artifactory repository a “project-version-plain-war” file which doe…
Spring jpa repository returns the entity class instead of the dto interface
I am using Spring data jpa in the backend codes. I have included entities, dto interfaces, service and jpa repository codes. Now the issue is that when I call getAllTopics() in the TopicService. It returns a list of Topic object instead of TopicDto. Topic object includes a list of examples which I do not incl…
How to edit configmap configuration in spring boot kubernetes application during runtime
We have application with huge configuration (this is just a part): I follow this example to bind configmap with spring boot configuration but there is still some problem for example how to solve null in yaml which spring yaml postprocessor resolve as empty string: issue second problem is how to handle this co…
Optaplanner – spring BeanCreationException
I’m migrating Optaplanner from v7.x to v8.14 on a project that uses spring-boot (as a web api). I’ve added the optaplanner-spring-boot-starter dependency to the project, however when starting the application, I got the following error : The project is in two separated modules, one with everything …