Grails Spring Security UI验证注册错误

Grails Spring Security UI验证注册错误,grails,spring-security,Grails,Spring Security,当我点击验证SpringSecurityUI插件发送到电子邮件的链接时,我收到了这个错误 Error 2013-07-20 01:12:14,684 [http-bio-8080-exec-6] ERROR errors.GrailsExceptionResolver - MySQLIntegrityConstraintViolationException occurred when processing request: [GET] /Professionals.az/register/ve

当我点击验证SpringSecurityUI插件发送到电子邮件的链接时,我收到了这个错误

Error 2013-07-20 01:12:14,684 [http-bio-8080-exec-6] ERROR errors.GrailsExceptionResolver  - MySQLIntegrityConstraintViolationException occurred when processing request: [GET] /Professionals.az/register/verifyRegistration - parameters:
t: 4dc5d16cb60742809c7ef270f41cecdc
Duplicate entry '2-25' for key 'PRIMARY'. Stacktrace follows:
Message: Duplicate entry '2-25' for key 'PRIMARY'
    Line | Method
->>  411 | handleNewInstance    in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    386 | getInstance          in     ''
|   1039 | createSQLException . in com.mysql.jdbc.SQLError
|   4096 | checkErrorPacket     in com.mysql.jdbc.MysqlIO
|   4028 | checkErrorPacket . . in     ''
|   2490 | sendCommand          in     ''
|   2651 | sqlQueryDirect . . . in     ''
|   2683 | execSQL              in com.mysql.jdbc.ConnectionImpl
|   2144 | executeInternal . .  in com.mysql.jdbc.PreparedStatement
|   2444 | executeUpdate        in     ''
|   1997 | executeBatchSerially in     ''
|   1468 | executeBatch         in     ''
|    297 | executeBatch . . . . in org.apache.commons.dbcp.DelegatingStatement
|    687 | withTransaction      in org.grails.datastore.gorm.GormStaticApi
|    158 | doCall . . . . . . . in az.com.controllers.register.RegisterController$_closure3$$EOC4Qhoo
|    195 | doFilter             in grails.plugin.cache.web.filter.PageFragmentCachingFilter
|     63 | doFilter . . . . . . in grails.plugin.cache.web.filter.AbstractFilter
|   1110 | runWorker            in java.util.concurrent.ThreadPoolExecutor
|    603 | run . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run                  in java.lang.Thread

我遇到了同样的问题。发生在我身上的事情是,我已经为尝试进行验证的用户插入了UserRole条目。因此,导致重复条目异常


尝试检查您是否没有插入控制器也插入到数据库中的条目。

它在stacktrace中-您尝试插入相同的数据两次。您的意思是更新vs insert,还是有一些旧数据尚未删除。它发生在此处registrationCode.delete()它发生在删除过程中显示控制器和domainRegistrationCode.withTransaction{status->user=lookupUserClass().findByUsername(registrationCode.username)if(!user){return}user.accountLocked=false user.save(flush:true)def UserRole=lookupUserRoleClass()def Role=lookupureclass()(conf.ui.register.defaultRoleNames中的roleName){UserRole.create user,Role.findbyaauthority(roleName)}registrationCode.delete()}