0

嗨,我在 grails 应用程序中使用 xfire 插件,Belov 是服务编写的,

class HelloWorldService {

static expose=['xfire']
void addBook(String pName,String pAuthor) {
    def b=new Book()
    b.name=pName
    b.author=pAuthor
    println b.name
    println b.author
    if(!b.save())
    {
        b.errors.each { println it }
    }
    else
    {
        println "saved"
    }

}
}

当客户端使用参数请求此 addBook 方法时,出现错误,

groovy.lang.MissingMethodException:没有方法签名:patienthealthhistory.Book.save() 适用于参数类型:() 值:[]

为什么会这样?

PLz谁能帮我解决这个问题..等待答案..

4

1 回答 1

0

I'm assuming the error is occurring on this line

if(!b.save())

The only reason I can think of why the save() method would be missing is that Book is not a domain class

于 2011-08-16T09:12:22.297 回答