在控制器中渲染JSOn会产生奇怪的错误

时间:2013-09-23 12:54:47

标签: json grails

我在控制器中渲染一个返回JSON值:

 def index = {

        def g_resourcen = []
        def g_standorte = []


    def query = "from Resource as b where b.typ='MDLT' and b.varchar_1 <> '' order by b.name"

        Resource.findAll(query).each{


                g_standorte << [id:it.id, name:it.name, standorte: it.standorte]
                g_resourcen << [id:it.id, name:it.name, gruppe: it.resourcenGruppe]
            }

        println("1: ");
        println(g_resourcen);

        println("2: ")
        println(g_standorte);


        [  g_resourcen: g_resourcen as JSON, 
         g_standorte: g_standorte as JSON
     ]


    }

并在客户端检索它,如下所示:

 var g_standorte = dojo.fromJson('${g_standorte}');

g_resourcen工作正常,但g_standort会出错。我的代码中有多种情况,就像这个工作一样。但在这里我不断收到这个奇怪的错误:

Error 500: Error processing GroovyPageView: org.codehaus.groovy.grails.web.converters.exceptions.ConverterException: Error converting Bean with class sun.proxy.$Proxy15
Servlet: grails
URI: /etermin/grails/terminKorridor/index.dispatch
Exception Message: No signature of method: com.digithurst.global.utils.db.PostgresUtilities$_integerToSqlArray_closure17.doCall() is applicable for argument types: () values: [] Possible solutions: doCall(long, int, java.util.Map), call(), call([Ljava.lang.Object;), call(java.lang.Object), call(long, int, java.util.Map), equals(java.lang.Object) 
Caused by: Error processing GroovyPageView: org.codehaus.groovy.grails.web.converters.exceptions.ConverterException: Error converting Bean with class sun.proxy.$Proxy15 
Class: /WEB-INF/grails-app/views/terminKorridor/index.gsp 
At Line: [-1] 
Code Snippet:

0 个答案:

没有答案