Monitoring Spring Boot Application With Prometheus and Grafana

In this article, we will be looking at how we can monitor our Spring Boot application using Grafana. We would be looking into the whole setup and creating a simple dashboard to view some metrics. Every application that is on production needs some kind of monitoring to see how the application is performing. This will … Read more

junit – Spring Boot active profile not found

Spring 2.4.5. Trying to run test examples. 2022-06-30 21:58:39.897 INFO — [ Test worker] .b.t.c.SpringBootTestContextBootstrapper : Neither @ContextConfiguration nor @ContextHierarchy found for test class [dataset.status.dashboard.api.repository.StatusRepositoryIntegrationTest], using SpringBootContextLoader 2022-06-30 21:58:39.901 INFO — [ Test worker] : Could not detect default resource locations for test class [dataset.status.dashboard.api.repository.StatusRepositoryIntegrationTest]: no resource found for suffixes {-context.xml, Context.groovy}. 2022-06-30 21:58:39.902 … Read more

java – Error when configuring Spring applications using annotations

I recently started learning Spring Framework, namely dependency injection. When using annotations I get the same error. (In this case with @Component) Before that, I used XML configuration for dependency injection and everything worked. jun 30, 2022 4:40:36 PM refresh WARNING: Exception encountered during context initialization – cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean … Read more

java – Content type ‘application/octet-stream’ not supported for bodyType when using MockServer in spring boot

I am trying to test the serialization of responses between two microservices. For that I want my mocked service to return a predefined response every time a post request to a specific path is made, but it throws errors. I tried pretty much everything in my power so far so I turn to thy oh … Read more

java – Spring Data JPA – Consider defining a bean named ‘entityManagerFactory’ in your configuration

I am developing an application in Spring, using Tomcat, Mysql5, Java8… The problem is that I cannot deploy it, due to “required bean ‘entityManagerFactory’ not found” problem. I have developed this project with my coworkers but they can perfectly deploy it with any problems, even if I copy-paste the same project in Spring Tool Suite. … Read more

reactjs – Getting Axios from React to Work with Spring Boot + Spring Boot Security

I have created a react app with a spring boot backend but I’m having trouble pulling the data through with axios. I have checked numerous SO posts as well as documentation with spring to no avail. I was initially blocked by CORS but I was able to resolve that with Spring Security. However, spring security … Read more

Spring Boot v2.6.7 and Hashicoprt vault Integration issue, unable to fetch the DB details

I am using Spring Boot v2.6.7 and trying to integrate Spring Cloud Config server, Hashicprp Vault within microservices. I went through links like: and html/config-data.html but still lo luck. pom.xml <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”″ xmlns:xsi=”” xsi:schemaLocation=””> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.6.7</version> <relativePath/> <!– lookup parent from repository –> </parent> <groupId>com.example</groupId> <artifactId>order-service</artifactId> … Read more

5 Observations on Spring Boot’s Loading Precedence for Properties Files With Spring Cloud Config | by KBryan | Jun, 2022

Sharing my experience on the order of precedence for properties files in Spring Boot applications when using Spring Cloud Config and Spring Profiles Photo by Brett Jordan on Unsplash Do you externalize and centralize your configurations using Spring Cloud Config Server? Do you use Spring Profiles to manage your configurations for different deployment environments? Do … Read more

spring boot – H2 memory database not starting

I have a spring boot application hosted on heroku, which uses a postgres db on heroku. I have configured config vars on heroku and am using them in my spring boot application like this : and in my code I use a connectionService: public static Connection getConnection() { try { final String dbUrl = System.getenv(“SPRING_DATASOURCE_URL”); … Read more

spring boot – i called the method of function of another package while calling i get a service is null in called class because two controller has service

spring boot – i called the method of function of another package while calling i get a service is null in called class because two controller has service – Stack Overflow … Read more