{"action":"closed","issue":{"url":"https://api.github.com/repos/grails/grails-core/issues/10221","repository_url":"https://api.github.com/repos/grails/grails-core","labels_url":"https://api.github.com/repos/grails/grails-core/issues/10221/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-core/issues/10221/comments","events_url":"https://api.github.com/repos/grails/grails-core/issues/10221/events","html_url":"https://github.com/grails/grails-core/issues/10221","id":182683986,"number":10221,"title":"Grails 3.2.0 json hasMany serialization error - cannot be cast to org.grails.datastore.mapping.proxy.EntityProxy - (3.1.x works fine)","user":{"login":"codeconsole","id":544750,"avatar_url":"https://avatars.githubusercontent.com/u/544750?v=3","gravatar_id":"","url":"https://api.github.com/users/codeconsole","html_url":"https://github.com/codeconsole","followers_url":"https://api.github.com/users/codeconsole/followers","following_url":"https://api.github.com/users/codeconsole/following{/other_user}","gists_url":"https://api.github.com/users/codeconsole/gists{/gist_id}","starred_url":"https://api.github.com/users/codeconsole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeconsole/subscriptions","organizations_url":"https://api.github.com/users/codeconsole/orgs","repos_url":"https://api.github.com/users/codeconsole/repos","events_url":"https://api.github.com/users/codeconsole/events{/privacy}","received_events_url":"https://api.github.com/users/codeconsole/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/grails/grails-core/milestones/177","html_url":"https://github.com/grails/grails-core/milestones/grails-3.2.1","labels_url":"https://api.github.com/repos/grails/grails-core/milestones/177/labels","id":1990497,"number":177,"title":"grails-3.2.1","description":"","creator":{"login":"graemerocher","id":66626,"avatar_url":"https://avatars.githubusercontent.com/u/66626?v=3","gravatar_id":"","url":"https://api.github.com/users/graemerocher","html_url":"https://github.com/graemerocher","followers_url":"https://api.github.com/users/graemerocher/followers","following_url":"https://api.github.com/users/graemerocher/following{/other_user}","gists_url":"https://api.github.com/users/graemerocher/gists{/gist_id}","starred_url":"https://api.github.com/users/graemerocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graemerocher/subscriptions","organizations_url":"https://api.github.com/users/graemerocher/orgs","repos_url":"https://api.github.com/users/graemerocher/repos","events_url":"https://api.github.com/users/graemerocher/events{/privacy}","received_events_url":"https://api.github.com/users/graemerocher/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":11,"state":"open","created_at":"2016-09-08T06:56:54Z","updated_at":"2016-10-13T05:55:49Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-10-13T03:02:25Z","updated_at":"2016-10-13T05:55:49Z","closed_at":"2016-10-13T05:55:49Z","body":"Concise example here: https://github.com/codeconsole/grails3bugs \r\n\r\n\r\n`ERROR org.grails.web.errors.GrailsExceptionResolver - ClassCastException occurred when processing request: [GET] /sets.json\r\nexample.FlashCard cannot be cast to org.grails.datastore.mapping.proxy.EntityProxy. Stacktrace follows:\r\njava.lang.reflect.InvocationTargetException: null\r\n        at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:210)\r\n        at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:187)\r\n        at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)\r\n        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)\r\n        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)\r\n        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\r\n        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)\r\n        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\r\n        at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)\r\n        at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)\r\n        at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n        at java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.ClassCastException: example.FlashCard cannot be cast to org.grails.datastore.mapping.proxy.EntityProxy\r\n        at org.grails.datastore.mapping.proxy.JavassistProxyFactory.getIdentifier(JavassistProxyFactory.java:56)\r\n        at org.grails.orm.hibernate.proxy.SimpleHibernateProxyHandler.getProxyIdentifier(SimpleHibernateProxyHandler.java:145)\r\n        at org.grails.orm.hibernate.proxy.SimpleHibernateProxyHandler.getIdentifier(SimpleHibernateProxyHandler.java:71)\r\n        at org.grails.datastore.gorm.proxy.ProxyHandlerAdapter.getProxyIdentifier(ProxyHandlerAdapter.java:22)\r\n        at org.grails.web.converters.marshaller.json.DomainClassMarshaller.asShortObject(DomainClassMarshaller.java:224)\r\n        at org.grails.web.converters.marshaller.json.DomainClassMarshaller.marshalObject(DomainClassMarshaller.java:192)\r\n        at org.grails.web.converters.marshaller.json.DomainClassMarshaller.marshalObject(DomainClassMarshaller.java:52)\r\n        at grails.converters.JSON.value(JSON.java:184)\r\n        at grails.converters.JSON.convertAnother(JSON.java:144)\r\n        at org.grails.web.converters.marshaller.json.CollectionMarshaller.marshalObject(CollectionMarshaller.java:41)\r\n        at org.grails.web.converters.marshaller.json.CollectionMarshaller.marshalObject(CollectionMarshaller.java:30)\r\n        at grails.converters.JSON.value(JSON.java:184)\r\n        at grails.converters.JSON.render(JSON.java:119)\r\n        at org.grails.plugins.web.rest.render.json.DefaultJsonRenderer.renderJson(DefaultJsonRenderer.groovy:116)\r\n        at org.grails.plugins.web.rest.render.json.DefaultJsonRenderer.renderJson(DefaultJsonRenderer.groovy:110)\r\n        at org.grails.plugins.web.rest.render.json.DefaultJsonRenderer.render(DefaultJsonRenderer.groovy:91)\r\n        at grails.artefact.controller.RestResponder$Trait$Helper.internalRespond(RestResponder.groovy:188)\r\n        at grails.artefact.controller.RestResponder$Trait$Helper.respond(RestResponder.groovy:62)\r\n        at grails.rest.RestfulController.index(RestfulController.groovy:64)\r\n        at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96)\r\n        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)\r\n        at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)\r\n        ... 14 common frames omitted`\r\n\r\n\r\nThis is a freshly created **Grails 3.2.0** application with the following modifications:\r\n\r\n\tgrails create-app example\r\n\r\n**BUG** \r\n\r\nmodified **UrlMappings.groovy** \r\n\r\n\t\"/sets\"(resources: \"flashCardSet\") {} \r\n\r\ncreated **FlashCard.groovy** \r\n\r\n    String question\r\n    String answer \r\n\r\ncreated **FlashCardSet.groovy**     \r\n\r\n    String name\r\n    static hasMany = [flashCards: FlashCard]\r\n\r\ncreated **FlashCardController.groovy**  \r\n\r\n    static scaffold = FlashCard \r\n\r\ncreated **FlashCardSetController.groovy**  \r\n\r\n    static scaffold = FlashCardSet        \r\n\r\nmodified **BootStrap.groovy**\r\n    \r\n    FlashCardSet set = new FlashCardSet(name:'Commerical 172RG')\r\n    FlashCard f = new FlashCard(question: 'question', answer: 'answer').save(flush: true)\r\n    set.addToFlashCards(f)\r\n    set.save(flush: true)\r\n\r\nTo demonstrate the bug, visit http://localhost:8080/sets.json\r\n\r\njava.lang.ClassCastException: example.FlashCard cannot be cast to org.grails.datastore.mapping.proxy.EntityProxy\r\n\r\n\r\n    \r\n"}}
{"actor":{"display_login":"graemerocher"}}