新博的问题解决了,以后如果遇到类似问题先执行 DELETE FROM user_role WHERE roleid NOT IN (SELECT roleid FROM app_role) 然后重启tomcat