Category "spring"

Mockito mock Java @Value with spring boot

Hi I have this simple code for my Spring Boot Project: @Component public class UserRowMapper implements RowMapper<User> { @Value("${bug.value}") p

Error creating bean with name 'mongoTemplate' defined in class path resource Mongobee

Using the Mongobee for Data Migration creating and error as Error creating bean with name 'mongoTemplate' defined in class path resource Migration configuration

Spring boot can not find resource file after packaging

I use Spring boot maven plugin to package application as jar file. It can find the resource file direct run in Itellij IDE, But it can not find resource file

Spring Boot Exception evaluating SpringEL expression

ERROR 4904 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "index": An error happene

I'm trying to add a jsp page in my Spring Boot Aplication. My problem is that every time I try to go to that page I have this:

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Apr 26 16:10:15 IRDT 2022 There was an unex

Spire Doc Free 3.9.0 not running in headless server

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.spire.doc.packages.sprDGC at com.spire.doc.formatting.CharacterFormat.spr (Un

postman returning "status": 404, "error": "Not Found", for the spring boot

Thank you in advance, Hello I am new to spring boot. I am facing a problem with spring boot. When I run my URL in postman it shows an error below. I have also u

ERROR 18080 --- [main] o.s.boot.SpringApplication : Application startup failed Spring boot

I know question like this have been already asked but I am new to spring boot and trying to run this program as java but getting error. I tried to search this e

How to set the user object to Sentry in Spring Boot?

In a Spring Boot project I have a SentryConfig.java file package example.services.bo.config; import org.springframework.context.annotation.Bean; i

Spring - is it possible to give same url (path) in request mapping for two different post methods?

Is it possible to map same path (uri) in request mapping for two different post methods, only difference is request body. Example @RequestMapping(value = "/he

validate input in Thymeleaf

I have this input: Masa: <input type="number" class="form-control form-text" name="masa"/> <div class="text col-sm-12 error" th:if="${wzrost}"

java.lang.NoSuchMethodException error in Spring-boot web-application when deploying on tomcat

I am deploying a Spring-boot web-application on 'tomcat 9' and I faced a NoSuchMethodException. I compile and run this code in localhost, successfully; but when

No qualifying bean of type 'org.springframework.batch.core.Job' available: expected single matching bean but found 2:

I have 2 jobs running in single spring batch application based on input parameters and it is working successfully. But when i run my test case, i'm getting the

Set of String is not acting normal in Spring JPA Projection Interface

I am using Projection Interface to return a partial view of an Entity, and the partial view contains a Set of String. I expect the Set works as normal but its n

Feign client : Load balancer does not have available server for client

I'm working on a microservice architecture, I'm using Feign client to make a rest call to another microservice. I using spring boot version 2.1.3.RELEASE and sp

Given ClassA and SubclassA, if I use Google Guice to bind ClassA to SubclassA then will SubclassA be injected as an instance where ClassA gets called?

Say I am given a scenario like this: @Data public class ClassA { private final String name = "ClassA"; public ClassA(){ //This constructor gets

@Transactional spring JPA .save() not necessary?

I understand that if we use annotation @Transactional. "save()" method is not necessary. Is it exact? And for my example: @Transactional void methodA() { .

multiple Spring integration task executors picking up same message from JMS queue

I am using spring integration to process multiple files from a queue. Following is my configuration: <si-jms:message-driven-channel-adapter id="someReg

TestEngine with ID 'junit-vintage' failed to discover tests - JUnitException: Failed to parse version of junit:junit: 4.13.2

I'm having a very weird issue with my Gradle config and JUnit, I have tried updating to 5.7+ but I'm getting the following exceptions: org/junit/jupiter/api/ex

TestEngine with ID 'junit-vintage' failed to discover tests - JUnitException: Failed to parse version of junit:junit: 4.13.2

I'm having a very weird issue with my Gradle config and JUnit, I have tried updating to 5.7+ but I'm getting the following exceptions: org/junit/jupiter/api/ex