开发者

Dynamic domain methods missing from grails service when injected into java service in grails app

I had the idea that I would write my GroovyDao as a grails service.

Next I would write a MyJavaService in java and locate it in the java sources dir in my grails app. MyJavaService contains a instance reference to groovyDao for spring injection.

I would wire up in resources.groovy the MyJavaService with a g开发者_开发问答roovyDao = ref("GroovyDao").

Everything starts up fine.

However if I make call to MyJavaService any Domain method like Domain.list() returns a Method not found error.

Any help is appreciated.


The Dynamic methods are only available in Groovy. Try putting you code in the src/groovy directory.

Also try putting the services in grails-app/services

Hope this helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜