我创建 Acl 的服务是这样的:
@Autowired
JdbcMutableAclService aclService;
public void createAcl(AclDTO aclDTO) throws ClassNotFoundException {
ObjectIdentity oi = new ObjectIdentityImpl(getClass().getClassLoader().loadClass(aclDTO.getClassPath()),
aclDTO.getObjectIdentityId());
Sid sid = new PrincipalSid(aclDTO.getSid());
Permission p = getPermission(aclDTO.getPermissionDesc());
// Create or update the relevant ACL
MutableAcl acl = null;
try {
acl = (MutableAcl) this.aclService.readAclById(oi);
} catch (NotFoundException nfe) {
acl = aclService.createAcl(oi);
}
// Now grant some permissions via an access control entry (ACE)
acl.insertAce(acl.getEntries().size(), p, sid, true);
this.aclService.updateAcl(acl);
}
但是这个类似乎有问题,当它运行时,我得到了这样的错误:
2019-02-25 11:02:18.410 错误 10608 --- [XNIO-2 task-1] cssacl.aop.logging.LoggingAspect:com.spring.security.acl.service.AccessGrantService.createAcl() 中的异常原因= 'com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: PROCEDURE security_acl.identity 不存在'并且异常 = 'StatementCallback; 错误的 SQL 语法 [call identity()]; 嵌套异常是 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: PROCEDURE security_acl.identity 不存在'
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; 错误的 SQL 语法 [call identity()]; 嵌套异常是 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: PROCEDURE security_acl.identity 不存在于 org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:93) at org.springframework.jdbc.support。 AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1398) at org .springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388) 在 org.springframework.jdbc.core。
如果有人可以帮助我解决这个问题,我将不胜感激!
泛舟湖上清波郎朗
慕后森
慕森卡
随时随地看视频慕课网APP
相关分类