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

Unable to load /env actuator endpoint in the app once plugin is used in the app #121

Open
dmahapatro opened this issue Jul 24, 2016 · 5 comments

Comments

@dmahapatro
Copy link
Contributor

Grails version: 3.1.9
Plugin Version: 2.0.1

Steps to recreate:

  • Create a sample app
  • Add the plugin to build.gradle
  • Enable actuator endpoints in application.yml.
  • ./gradlew bootRun
  • visit http://localhost:8080/env

Enabling actuator endpoints in application.yml:

endpoints:
    enabled: true
    jmx:
        enabled: true
    env:
        sensitive: false

Stacktrace:

ERROR org.grails.web.errors.GrailsExceptionResolver - JsonMappingException occurred when processing request: [GET] /env
No serializer found for class groovy.lang.GroovyClassLoader$1 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.LinkedHashMap["AuditConfig"]->java.util.LinkedHashMap["grails"]->groovy.util.ConfigObject["plugin"]->groovy.util.ConfigObject["auditLog"]->groovy.util.ConfigObject["actorClosure"]->grails.plugins.orm.auditable.__clinit__closure3["delegate"]->grails.plugins.orm.auditable.AuditLogListener["grailsApplication"]->grails.core.DefaultGrailsApplication["classLoader"]->groovy.lang.GroovyClassLoader["resourceLoader"]). Stacktrace follows:
org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class groovy.lang.GroovyClassLoader$1 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.LinkedHashMap["AuditConfig"]->java.util.LinkedHashMap["grails"]->groovy.util.ConfigObject["plugin"]->groovy.util.ConfigObject["auditLog"]->groovy.util.ConfigObject["actorClosure"]->grails.plugins.orm.auditable.__clinit__closure3["delegate"]->grails.plugins.orm.auditable.AuditLogListener["grailsApplication"]->grails.core.DefaultGrailsApplication["classLoader"]->groovy.lang.GroovyClassLoader["resourceLoader"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class groovy.lang.GroovyClassLoader$1 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.LinkedHashMap["AuditConfig"]->java.util.LinkedHashMap["grails"]->groovy.util.ConfigObject["plugin"]->groovy.util.ConfigObject["auditLog"]->groovy.util.ConfigObject["actorClosure"]->grails.plugins.orm.auditable.__clinit__closure3["delegate"]->grails.plugins.orm.auditable.AuditLogListener["grailsApplication"]->grails.core.DefaultGrailsApplication["classLoader"]->groovy.lang.GroovyClassLoader["resourceLoader"])
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class groovy.lang.GroovyClassLoader$1 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.LinkedHashMap["AuditConfig"]->java.util.LinkedHashMap["grails"]->groovy.util.ConfigObject["plugin"]->groovy.util.ConfigObject["auditLog"]->groovy.util.ConfigObject["actorClosure"]->grails.plugins.orm.auditable.__clinit__closure3["delegate"]->grails.plugins.orm.auditable.AuditLogListener["grailsApplication"]->grails.core.DefaultGrailsApplication["classLoader"]->groovy.lang.GroovyClassLoader["resourceLoader"])
    at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:69)
    at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:32)
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:693)
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:693)
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:693)
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
    at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:693)
    at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
    at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
    at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:561)
    at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:469)
    at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:29)
    at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:561)
@robertoschwald
Copy link
Member

Reproduced.

Same issue reported by another one. spring-boot-actuator problem?
http://stackoverflow.com/questions/38195998/spring-boot-actuator-env-endpoint-response-malformed-when-closure-specified-in

@dmahapatro
Copy link
Contributor Author

Looks like it. But your fix will keep this plugin out of the radar. :) Thank you for the fix. I am preoccupied with bunch of other stuff otherwise I would have sent a PR after thorough testing. If possible please do a sanity check for other available actuator endpoints.

@robertoschwald
Copy link
Member

Tested the supposed fix, doesn't help :(

@robertoschwald
Copy link
Member

robertoschwald commented Jul 25, 2016

When I annotate AuditLogListener.grailsApplication with "@JsonIgnore", I get a different error when using JDK 1.7.0_79 in the audit-test application (Grails 3.0.10):

*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844

@robertoschwald
Copy link
Member

Is a Jackson error. We reported to grails/grails-core#10279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants