{"action":"created","issue":{"url":"https://api.github.com/repos/grails/grails-core/issues/10883","repository_url":"https://api.github.com/repos/grails/grails-core","labels_url":"https://api.github.com/repos/grails/grails-core/issues/10883/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-core/issues/10883/comments","events_url":"https://api.github.com/repos/grails/grails-core/issues/10883/events","html_url":"https://github.com/grails/grails-core/issues/10883","id":278918446,"number":10883,"title":"Domain not found in mapping context api when converting as JSON","user":{"login":"mamunsrdr","id":7427958,"avatar_url":"https://avatars0.githubusercontent.com/u/7427958?v=4","gravatar_id":"","url":"https://api.github.com/users/mamunsrdr","html_url":"https://github.com/mamunsrdr","followers_url":"https://api.github.com/users/mamunsrdr/followers","following_url":"https://api.github.com/users/mamunsrdr/following{/other_user}","gists_url":"https://api.github.com/users/mamunsrdr/gists{/gist_id}","starred_url":"https://api.github.com/users/mamunsrdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamunsrdr/subscriptions","organizations_url":"https://api.github.com/users/mamunsrdr/orgs","repos_url":"https://api.github.com/users/mamunsrdr/repos","events_url":"https://api.github.com/users/mamunsrdr/events{/privacy}","received_events_url":"https://api.github.com/users/mamunsrdr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-12-04T09:01:08Z","updated_at":"2017-12-06T16:06:41Z","closed_at":null,"author_association":"NONE","body":"[Duplicated post] When I'm trying to convert mongo entity using grails.converter.JSON, it's throwing the following exception `Could not retrieve the respective entity for domain Workspace in the mapping context API`. \r\nDependency:\r\n```\r\n//grailsVersion 3.3.1\r\ncompile \"org.grails.plugins:converters\"\r\ncompile 'org.grails.plugins:mongodb:6.1.4'\r\ncompile \"org.mongodb:mongodb-driver:3.5.0\"\r\n```\r\n\r\nDomain class:\r\n```\r\nclass Workspace {\r\n    static mapWith = \"mongo\"\r\n\r\n    ObjectId id\r\n    String name\r\n    List<ObjectId> formIds\r\n    long companyId\r\n\r\n    static mapping = {\r\n        collection 'eform_workspace'\r\n    }\r\n}\r\n```\r\nService code snippet:\r\n```\r\nList<Workspace> workspaces = Workspace.findAll()\r\nString workspaceJson = workspaces as JSON // produces exception\r\nreturn [\r\n       workspacesJson: workspaceJson\r\n]\r\n```\r\nStacktrace:\r\n```\r\nCaused by: java.lang.RuntimeException: org.grails.core.exceptions.GrailsConfigurationException: Could not retrieve the respective entity for domain Workspace in the mapping context API\r\n        at org.grails.web.converters.AbstractConverter.toString(AbstractConverter.java:120)\r\n        at org.codehaus.groovy.runtime.typehandling.ShortTypeHandling.castToString(ShortTypeHandling.java:44)\r\n        at com.example.artifact.form.service.EformHomeService$$EQcpF3wG.$tt__getUserWorkspaces(EformHomeService.groovy:14)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.springsource.loaded.ri.ReloadedTypeInvoker$2.invoke(ReloadedTypeInvoker.java:133)\r\n        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1462)\r\n        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)\r\n        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)\r\n        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)\r\n        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)\r\n        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:925)\r\n        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:908)\r\n        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(InvokerHelper.java:76)\r\n        at com.example.artifact.form.service.EformHomeService$_getUserWorkspaces_closure1$$EQcpF3wG.doCall(EformHomeService.groovy)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.springsource.loaded.ri.ReloadedTypeInvoker$2.invoke(ReloadedTypeInvoker.java:133)\r\n        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1462)\r\n        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)\r\n        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)\r\n        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)\r\n        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)\r\n        at groovy.lang.Closure.call(Closure.java:414)\r\n        at com.example.artifact.form.service.EformHomeService$_getUserWorkspaces_closure1.call(EformHomeService.groovy)\r\n        at groovy.lang.Closure.call(Closure.java:430)\r\n        at com.example.artifact.form.service.EformHomeService$_getUserWorkspaces_closure1.call(EformHomeService.groovy)\r\n        at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)\r\n        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)\r\n        at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)\r\n        at com.example.artifact.form.service.EformHomeService$$EQcpF3wG.getUserWorkspaces(EformHomeService.groovy)\r\n        at com.example.artifact.form.service.EformHomeService$$DQcpF3wG.getUserWorkspaces(Unknown Source)\r\n        at com.example.artifact.form.service.EformHomeService.getUserWorkspaces(EformHomeService.groovy)\r\n        at com.example.artifact.form.service.EformHomeService$getUserWorkspaces$0.call(Unknown Source)\r\n        ... 98 common frames omitted\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/grails/grails-core/issues/comments/349686098","html_url":"https://github.com/grails/grails-core/issues/10883#issuecomment-349686098","issue_url":"https://api.github.com/repos/grails/grails-core/issues/10883","id":349686098,"user":{"login":"jameskleeh","id":1583789,"avatar_url":"https://avatars2.githubusercontent.com/u/1583789?v=4","gravatar_id":"","url":"https://api.github.com/users/jameskleeh","html_url":"https://github.com/jameskleeh","followers_url":"https://api.github.com/users/jameskleeh/followers","following_url":"https://api.github.com/users/jameskleeh/following{/other_user}","gists_url":"https://api.github.com/users/jameskleeh/gists{/gist_id}","starred_url":"https://api.github.com/users/jameskleeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jameskleeh/subscriptions","organizations_url":"https://api.github.com/users/jameskleeh/orgs","repos_url":"https://api.github.com/users/jameskleeh/repos","events_url":"https://api.github.com/users/jameskleeh/events{/privacy}","received_events_url":"https://api.github.com/users/jameskleeh/received_events","type":"User","site_admin":false},"created_at":"2017-12-06T16:06:41Z","updated_at":"2017-12-06T16:06:41Z","author_association":"CONTRIBUTOR","body":"@mamunsrdr Please upload an example application with steps to reproduce"}}
{"actor":{"display_login":"jameskleeh"}}