groovy.lang.MissingPropertyException:没有这样的属性:withSql for class:org.codehaus.griffon.runtime.builder.UberBuilder at addressbook.AddressbookView $ _run_closure1_closure2_closure7_closure8.doCall(AddressbookView.groovy:14) at addressbook.AddressbookView $ _run_closure1_closure2_closure7.doCall(AddressbookView.groovy:13) at addressbook.AddressbookView $ _run_closure1_closure2_closure7.doCall(AddressbookView.groovy) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:96) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this $ 3 $ invokeFactoryMethod(UberInterceptorMetaClass.groovy) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass $ this $ 3 $ invokeFactoryMethod.callCurrent(Unknown Source) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:140) at addressbook.AddressbookView $ _run_closure1_closure2.doCall(AddressbookView.groovy:12) at addressbook.AddressbookView $ _run_closure1_closure2.doCall(AddressbookView.groovy) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:96) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this $ 3 $ invokeFactoryMethod(UberInterceptorMetaClass.groovy) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass $ this $ 3 $ invokeFactoryMethod.callCurrent(Unknown Source) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:140) at addressbook.AddressbookView $ _run_closure1.doCall(AddressbookView.groovy:11) at addressbook.AddressbookView $ _run_closure1.doCall(AddressbookView.groovy) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:96) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this $ 3 $ invokeFactoryMethod(UberInterceptorMetaClass.groovy) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass $ this $ 3 $ invokeFactoryMethod.callCurrent(Unknown Source) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:167) at addressbook.AddressbookView.run(AddressbookView.groovy:10) 在org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:151) 在org.codehaus.griffon.runtime.builder.UberBuilder.build(UberBuilder.groovy:155) 在org.codehaus.griffon.runtime.core.AbstractMVCGroup $ 1.run(AbstractMVCGroup.java:129)
答案 0 :(得分:0)
默认情况下,GSQL / Datasource插件不会将withSql
方法注入到Views中,您必须更改配置(在插件页面中说明)。但是我强烈建议不要在View中注入这样的方法,因为在UI线程内部构建了视图,在这个线程中进行数据库调用确实是个坏主意。