Skip to content

LiveBeansView generates invalid JSON on specific case [SPR-11366] #15992

Closed
@spring-projects-issues

Description

@spring-projects-issues

Ilayaperumal Gopinathan opened SPR-11366 and commented

In org.springframework.context.support.LiveBeansView, the JSON snapshot of beans has a comma "," at the end of the last bean definition on a specific case when one of these met:

  1. If any of the bean definitions in the context's bean factory is of infrastructure bean
  2. If the bean is lazily initialized
  3. If the bean is not singleton

It looks like the logic to generate the JSON in "generateJson(Set<ConfigurableApplicationContext> contexts)" method adds comma "," to the bean definitions based on the beanNames length. But if any of the above conditions met this adds the comma to the last bean definition as well. This causes the JSON to be invalid.


Affects: 3.2 GA, 4.0 GA

Issue Links:

  • XD-1271 Investigate missing boot's actuator endpoints in XD

Backported to: 3.2.8

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions