0
내 컨트롤러 중 하나에서 새로운 사용자를 생성하는 데 문제가 있습니다. 이렇게 MongoDB 사용자 컬렉션에 새 사용자를 추가하려고합니다. 권한은 도메인에서 역할 세트로 정의됩니다.grails spring-security 사용자를 생성하십시오
Role role = new Role(authority:"ROLE_USER")
User user = new User(username:params.username,email:params.email,password:params.password,enabled:params.enabled,
accountExpired:params.accountExpired,accountLocked:params.accountLocked,passwordExpired:params.passwordExpired,
authorities:[role])
if (user.validate()) {
user.save(flush:true)
} else {
user.errors.allErrors.each { println it }
}
정확한 동일한 코드는 부트 스트랩에서 성공적으로 사용자를 생성 할 수 있습니다,하지만 난이 오류지고있어 간단한 컨트롤러에서 같은 일을 할 노력하고있어 때
2012-09-24 10:43:27,450 [http-8080-3] ERROR binding.GrailsDataBinder - Unable to auto-create type interface java.util.Set, class java.lang.InstantiationException thrown in constructor
을
a : 662)
보고 할 수 있습니다. 그러나 MongoDB와의 연결처럼 보이는 것입니다. detailService는이 질문에 대해 UserRole 속성을 신경 쓰지 않습니다. 그러나 지금은 내 물건을 구할 수 있지만 다른 문제는 atm하고 있습니다. –