im trying to get a value from the application.properties in a Spring boot app. The class is defined with the tag @Component, I already tried @Service too, and with @PropertySource(“classpath:application.properties”) and without the @PropertySource but in any case they get the value. The interface is defined like this And the superior interface In any case I tried without implementing the
Tag: spring-boot
Spring Boot: How to find name by a case sensitive parameter in a MySQL database
I make simple database of names. There are only three names: Adam , Arnold and Matin. And I want to get all names that contains letter “a”. I have in my repository this method: Let String letter = “a”; It returns all names(List of names), because it find some “a” or “A” in all of names. But I want to
Failed to read candidate component class when testing Spring Data Repository – IndexOutOfBoundsException
I’m trying to test a Spring Data JPA repository but when I run the test I always get the following error The class it talks about is a pretty simple entity If I comment the @Table annotation I get the same error on the next class. I also had the issue on a classe with @Cacheable and it gave me
SpringBoot app does not run with exceptions
I am new at Spring Boot so I’m trying to create a simple Crud but I keep getting this error when I run my application I spose it must be some version problem but I don’t know how to fix it. I created the project with STS on ubuntu using mostly default options Answer It looks like you have java
How to debug a JDK docker container in intellij idea?
I want to start up a docker container with debug options as follows, but the startup won’t work: Dockerfile: docker-compose.yml: Result: Sidenote: Port 5005 is of course not running/listening on my host! Also, if I change the port to 5006, 5007 etc, the error is always the same. So why is the port blocked on mvn spring-boot:run? Answer The problem
ClassNotFoundException: org.apache.log4j.Priority when using Filenet APIs
I am using Spring Boot 2.7.2 to create a rest API that communicate with Filenet Content Engine using Filenet APIs and my pom file as follows : The project compiles and starts up fine, but when trying to execute any filenet API I get a log4j error: That is because filenet APIs is using log4j1 classes. The class is :
Run Spring Boot Project with base directory – localhost:8080/demo/
I have setup a run configuration in eclipse but it’s running in localhost:8080 but I want it to run in localhost:8080/demo/ but it’s not working. I have attached the run configuration and application properties file can anyone help me to run spring boot project in localhost:8080/demo/ Answer I think that you can just add this to your properties file
How to find a Bean instance of MongoRepository?
I am trying to use a MongoRepository, but Spring complains, that no instance of the MonoRepository-Interface is in the context. The server complains: my maven pom.xml: How can I get a bean instance of my MongoRepository? Answer The dependency is incorrect. spring-data-mongodb only makes it compile: But you need additional dependencies, to make it run. For convenience you can import
Migrate builder to Spring hateoas 2.6.7
I have this old code implemented in hateoas:1.0 I updated my code to hateoas 2.6.7 but the code is changed this way: What is the proper way to implement this change? I tried this: But it’s not clear how I have to implement the code that I can send affordances. Can you advice what is the proper way to implement
Does the use of Spring Webflux’s WebClient in a blocking application design cause a larger use of resources than RestTemplate
I am working on several spring-boot applications which have the traditional pattern of thread-per-request. We are using Spring-boot-webflux to acquire WebClient to perform our RESTful integration between the applications. Hence our application design requires that we block the publisher right after receiving a response. Recently, we’ve been discussing whether we are unnecessarily spending resources using a reactive module in our