src/main/java/com/whyc/realm/CustomRealm.java
@@ -11,6 +11,7 @@ import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.util.ByteSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import javax.annotation.PostConstruct; @@ -20,6 +21,8 @@ @Realm public class CustomRealm extends AuthorizingRealm { /**必须@Lazy注解,@Lazy与@Autowired组合,使得依赖于Service相关的Bean都是lazy-resolution proxy*/ @Lazy @Autowired UserBridgeService userBridgeService;