Skip to content

Unable to resolve class groovy.json.JsonSlurper  #8867

@curtcox

Description

@curtcox

To recreate, put the following in a file, say bug.groovy

@RestController
class Bug {

    @RequestMapping("*")
    String home() {
    	new groovy.json.JsonSlurper()
        "!"
    }

}

Run it:

spring run bug.groovy 
startup failed:
file:/Users/curt.cox/tmp/spring-boot/bug.groovy: 6: unable to resolve class groovy.json.JsonSlurper 
 @ line 6, column 6.
       	new groovy.json.JsonSlurper()
        ^

1 error

When writing groovy scripts, all of the standard groovy classes should be available. If you delete the line creating JsonSlurper, the application runs as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions