Open robertoschwald opened 7 years ago
Not sure if there is anything we can do about this really. The endpoint is part of Boot and the issue may need to be reported there.
Is it possible to either workaround that in Grails somehow, or provide the required serializer (or a NOOP error serializer) for this issue?
Will see what we can do
Not sure if there is anything we can do about this really. The endpoint is part of Boot and the issue may need to be reported there.
On the other hand, the logic that's "polluting" the Environment with a Groovy closure is part of Grails so it could be argued that Grails should ensure that things are sanitised such that Jackson can serialise them, or that it has customised the Actuator's ObjectMapper
such that it can serialise the closure. If Boot is lacking the hook points to let you do that then we can see if we can add them.
@wilkinsona Yes that could be argued. However, Grails for years has allowed richer configuration with closures to for example configure the default constraints and mapping in GORM http://gorm.grails.org/latest/hibernate/manual/index.html#_the_default_mapping_constraints
This issue would also impact use of GORM standalone outside of Grails if you were to use it in Spring Boot as is now possible http://gorm.grails.org/latest/hibernate/manual/index.html#springBoot
However, yes we can of course fix it only for Grails if the hook is available to do this. Configuration of GORM when using it standalone with Spring Boot would continue to be an issue.
@wilkinsona currently we have dependency on Grails to Actuator itself. Is there a way to fix this problem without introducing a dependency on Actuator?
Is there a way to fix this problem without introducing a dependency on Actuator?
I don't know, as I don't know what's required to fix the problem. I'm guessing a Jackson module might work but a bit of Googling hasn't turned up anything. If we can figure out how to fix the problem then hopefully it'll become obvious where that fix should go.
When you define a closure in application.groovy, Jackson fails in the /env endpoint.
Steps to reproduce
Create a standard Grails 3.1.13 project, which only has the following things changed:
Stacktrace
Expected Behaviour
Actual Behaviour
Environment Information
Example Application
https://github.com/robertoschwald/grails3-actuator-jackson-error
Just run it and access /env