Anonymous session is not initialized 添加系统身份认证后?

//添加系统身份验证
UserSession anonymousSession = trustedClientService.getAnonymousSession(restApiConfig.getTrustedClientPassword(),
restApiConfig.getSecurityScope());

                AppContext.setSecurityContext(new SecurityContext(anonymousSession));

添加系统身份认证后报:
java.lang.IllegalStateException: Anonymous session is not initialized. Check the application log for the original cause.
异常是什么原因????

贴出完整的异常堆栈看看