Closed suryamukerjee1982 closed 2 years ago
@tangyang9464 @seriouszyx @elfisworking @fangzhengjin
@tangyang9464
@suryamukerjee1982 The easiest solution is to remove the casbin-spring-boot-starter
dependency or jdbc-adapter
.
Because the CasbinRule
structure in casbin-spring-boot-starter
and jdbc-adapter
is conflicting. And It looks like you don't use casbin-spring-boot-starter
at all. Currently casbin-spring-boot-starter
has its own built-in jdbc-adapter
, but it is not compatible, so you cannot import jdbc-adapter
at the same time. This is a legacy problem, and we will fix it later.
Fixed by: https://github.com/jcasbin/casbin-spring-boot-starter/pull/68
@suryamukerjee1982 plz have a try
I am creating a Spring Boot app with spring data jpa and with the policy persisted in PostgreSQL DB.
pom ---
application.properties
Model - I am loading the model in my Main application class inside a Bean
### In my Filter Class, I am doing the following for initializing the Enforcer with the Model and the Policy-
### The application starts fine and the table casbin_rule gets created in my postgreSQL DB. But as soon as the code hits the enforcer.addPolicy() line, it throws an exception as follows -