我们正在尝试使用 JEE8 安全 API 创建一个 wildfly 16 高可用性集群。项目可以作为独立应用程序很好地工作,但不能作为集群!我们得到了一个 infispan NotSerializableException。
我们有一个带有 jsf 2.3、CDI 2.0 和 Soteria 的 Wildfly 16 独立应用程序。这作为独立运行良好。现在我们想将此配置作为独立的 wildfly-cluster 运行。野蝇来了,他们彼此认识。
但是当我们调用我们的应用程序时,我们得到以下异常: java.lang.IllegalArgumentException: org.infinispan.commons.marshall.NotSerializableException: org.glassfish.soteria.servlet.RequestData
如果需要,我们可以发布整个堆栈跟踪。
如果我们从 web.xml 中删除“可分发”,它将毫无例外地工作,但我们无法在实例之间共享会话。
我们是否缺少一些配置?还是我们有另一个误解?
谢谢您的帮助
@AutoApplySession
@LoginToContinue(loginPage = "/login.xhtml", errorPage = "", useForwardToLogin = true)
@ApplicationScoped
public class CustomAuthenticationMechanism implements HttpAuthenticationMechanism {
@Inject
private CustomIdentityStore identityStore;
...
}
@Model
public class LoginBean implements Serializable {
public void login() {
FacesContext context = FacesContext.getCurrentInstance();
Credential credential = new CustomCredential(username, password);
AuthenticationStatus status = securityContext.authenticate(
(HttpServletRequest) externalContext.getRequest(),
(HttpServletResponse) externalContext.getResponse(),
withParams()
.credential(credential)
.newAuthentication(false)
.rememberMe(true)
);
...
}
}
web.xml:
...
distributable
...
从 2019 年 7 月 3 日开始编辑:
正如我现在所看到的,问题出在 Soteria Impementation 中。我在 github 上找到了以下提交:“ https://github.com/eclipse-ee4j/soteria/commit/fd9a29c4452f99b426dabc296ec759d36766a56f ”。现在对我来说的问题是,这什么时候才能生效?它有哪些替代方案,以实现对资源的基于角色的访问并将未经身份验证的用户重定向到自定义登录页面?