0
我有一個問題如下所示;沒有簽名的方法:static org.springframework.security.oauth.User.withTransaction()
groovy.lang.MissingMethodException: No signature of method:
static org.springframework.security.oauth.User.withTransaction() is applicable for argument types:
(org.springframework.security.oauth.services.UserService$_saveUser_closure1) values:
[org.springf[email protected]2ed1e8 at
groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1357)
UserService:
class UserService {
public boolean saveUser(){
boolean retVal=false;
User.withTransaction{status ->
def sUser = new User()
sUser.setUsername("muhammed")
sUser.save()
retVal= true
}
return retVal;
}
}
User.groovy:
@Entity
class User {
String id;
String username;
String password;//social agent id
static constraints = {
username(nullable:true)
password(nullable:true)
}
static mapping = {
id generator: 'uuid'
}
}
什麼是我不能發現問題?
我改變了休眠它現在工作,groovy真的生病我:) –