Skip to content

org.springframework.context.support.LiveBeansView.generateJson(Set<ConfigurableApplicationContext>) generates invalid JSON when resources already double-quoted [SPR-12252] #16866

@spring-projects-issues

Description

@spring-projects-issues

Aldo Luciano opened SPR-12252 and commented

result.append(""resource": "").append(resource).append("",\n") in org.springframework.context.support.LiveBeansView.generateJson(Set<ConfigurableApplicationContext>) creates invalid JSON if resource already has quotes.

Found this issue while invoking actuator's /beans endpoint:

...
{
"bean": "securityConfig",
"scope": "singleton",
"type": "demo.SecurityConfig$$EnhancerBySpringCGLIB$$79f7591d",
"resource": ""/C:/Users/904311/Documents/workspace-sts-3.6.1.RELEASE/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1410896169876/deploy/jboss-demo.war/WEB-INF/classes/demo/SecurityConfig.class"",
...

...then com.fasterxml.jackson.core.json.ReaderBasedJsonParser._skipComment() throws an exception.


Affects: 3.2.11, 4.0.7

Backported to: 4.0.8, 3.2.12

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)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