Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Sep 25, 2014 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This will be available in the upcoming 4.1.1 snapshot. Please give it a try...

It'll get backported to 4.0.8 and 3.2.12 tonight.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Phil Webb commented

I've just pushed a fix to master to protect against an NPE which the Boot tests triggered. You probably want to include 3827e04 in the backports.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Alright - just in time...

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.1 milestone Jan 11, 2019
This was referenced Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants