Skip to content

Commit 04c8b91

Browse files
committed
Fall back to standard LiveBeansView behaviour when MBean is in use
Closes gh-8146
1 parent f27bb39 commit 04c8b91

File tree

2 files changed

+5
-2
lines changed
  • spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint
  • spring-boot-samples/spring-boot-sample-actuator

2 files changed

+5
-2
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/BeansEndpoint.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ private void setLeafContext(ApplicationContext leafContext) {
7575

7676
@Override
7777
public String getSnapshotAsJson() {
78+
if (this.leafContext == null) {
79+
return super.getSnapshotAsJson();
80+
}
7881
return generateJson(getContextHierarchy());
7982
}
8083

spring-boot-samples/spring-boot-sample-actuator/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
<groupId>org.springframework.boot</groupId>
2828
<artifactId>spring-boot-starter-web</artifactId>
2929
</dependency>
30-
<dependency>
30+
<!-- <dependency>
3131
<groupId>org.springframework.boot</groupId>
3232
<artifactId>spring-boot-starter-security</artifactId>
33-
</dependency>
33+
</dependency> -->
3434
<dependency>
3535
<groupId>org.springframework.boot</groupId>
3636
<artifactId>spring-boot-starter-jdbc</artifactId>

0 commit comments

Comments
 (0)