I have created a spring boot application - spring-data-jpa

I have added dependency for h2 in memory database in my pom.xml but i have not configured the h2 database properties in my application.properties but still my jpa class are getting created in h2 database, can someone tell how is it possible?

It is due to auto-configuration feature of spring boot
https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/html/using-boot-auto-configuration.html
Spring Boot auto-configuration attempts to automatically configure your Spring application based on the jar dependencies that you have added. For example, if HSQLDB is on your classpath, and you have not manually configured any database connection beans, then Spring Boot auto-configures an in-memory database.
You need to opt-in to auto-configuration by adding the #EnableAutoConfiguration or #SpringBootApplication annotations to one of your #Configuration classes.

Related

Spring Boot Admin and the business spring boot app in one war file?

Is it possible to just host the spring boot admin web app within the same spring boot app it is monitoring? Conceptually I want to deploy a single war file to my application server that contains my spring boot web app and the admin features provided by spring boot admin all-in-one war file. Does that make sense?

No bean Javers bean configured to be auto wired

I am trying to use javers latest version library with spring boot 3.0 .The document says when you have Javers starter files on classpath , spring boot automatically creates Javers bean . But while starting server , I get an error no bean configured for Javers bean for injecting . I am using Mongo db
I tried using the documentation but it didn't helped .

How to integrate Spring Batch ( without Spring Boot ) with Spring Cloud Data Flow Server

We are running spring batch with jboss application server (therefore cant run it as spring boot app). Is there any integration options for monitoring/administering spring batch with Spring Cloud DataFlowServer for the spring batch running in Jboss container ?
I had a similar issue where I was using spring batch with a weblogic 12.2.1.4 application server and wanted an admin console to view the status of job executions. Spring Cloud Data Flow was not suitable for my requirement. I ended up forking the old spring-batch-admin project and upgrading it to work with the latest version of spring batch and spring boot libraries. My forked git repo is here. I include this as a dependency in my war file that i deploy to weblogic and it provides the spring batch admin functionality, embedded in my application.

What controls the appearance of the "Web" option in the spring boot administrator UI?

I'm having an issue with using Spring Boot Administrator against a number of different Spring Boot microservices, where the Web left-hand menu option (which has the Mappings and HTTP Traces suboptions) only shows for some of the microservices.
The only obvious POM differences between those microservices that work and those that don't is the Spring Boot Starter parent version; those which display the Web option are using version 2.1.6.RELEASE, while those that do not are using higher versions like 2.3.1.RELEASE (which I'm guessing will affect versions of e.g. spring boot actuator libraries).
I'm using version 2.3.0 of Spring Boot Admin Server with Spring Boot Starter Parent 2.3.1.RELEASE.
For anyone else that stumbled upon this, the answer is that from Spring Boot 2.0.0 onwards, in order to expose the Spring Boot actuator httptrace endpoint (which is what drives the Web option in the Spring Boot Administrator), you now need to also add a bean that implements HttpTraceRepository into your Spring context.
e.g.
#Configuration
public class HttpTraceActuatorConfiguration {
#Bean
public HttpTraceRepository httpTraceRepository() {
return new InMemoryHttpTraceRepository();
}
}

Using eclipselink JPA and alter persistence context name while deploying on weblogic

While using JPA eclipse link, i would need my application to be deployed per tenant on a weblogic server. But this would not allow me to deploy multiple times with same persistene context name. So is there a way we can specify the persistence context name at runtime/deployment time?