JSF1094错误在cluster env中使用闪存时发生了
我在集群Env(Alb + Two Wildfly 17 +可分布设置)中使用PrimeFaces 11。 当我使用Flash从Page1传递参数到Page2时,我会收到以下错误,并且不能传递参数。
[javax.enterprise.resource.webcontainer.jsf.flash] (default task-29) JSF1094: Could not decode flash data from incoming cookie value Invalid characters in decrypted value. Processing will continue, but the flash is unavailable for this request.
如果我仅在一台服务器中运行它,则可以正常传递参数。
- 设置数据
flash flash = faceScontext.getCurrentInstance().getExternalContext()。getflash(); flash.put(redirect_data_key,rdata);
- 获取数据
flash flash = faceScontext.getCurrentInstance().getExternalContext()。getflash(); 返回(redirectData)flash.get(redirect_data_key);
我如何解决?
I am using primefaces 11 in a cluster env(alb + two wildfly 17 + distributable setting).
when I use Flash to pass parameter from page1 to page2, I got the following error, and the parameters can no be passed.
[javax.enterprise.resource.webcontainer.jsf.flash] (default task-29) JSF1094: Could not decode flash data from incoming cookie value Invalid characters in decrypted value. Processing will continue, but the flash is unavailable for this request.
If I run it in only one server, the parameters can be passed normally.
- set data
Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash(); flash.put(REDIRECT_DATA_KEY, rData);
- get data
Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash(); return (RedirectData) flash.get(REDIRECT_DATA_KEY);
How I can solve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自Red Hat Offical Support:
JSF/FlashSecretkey是Base64编码AES 256BIT键,用于加密闪存示波器cookie(例如CSFCFC = K8AUYBA%3D;。
键可以通过以下代码生成:
flash cookie值set-cookie:csfcfc = k8auyba%3D;默认情况下是AES加密的。如果未设置jndi键java:comp/env/jsf/jsf/flashsecretkey,则Mojarra将尝试创建一个随机秘密键,该密钥用于flash cookie值中的AES加密中使用。
在群集环境的情况下,该行为将导致每个聚类EAP实例具有不同的秘密密钥。结果,Mojarra无法通过以下错误消息恢复聚类的Flash Cookie值:
From Red Hat offical support:
jsf/FlashSecretKey is base64 encoded AES 256bit key which used for encrypting flash scope cookie like csfcfc=K8auYBA%3D;.
The key can generate by the following code:
The flash cookie value Set-Cookie: csfcfc=K8auYBA%3D; is AES encrypted by default. If JNDI key java:comp/env/jsf/FlashSecretKey is not set, Mojarra will try to create a random secret key that is used in AES encryption for the flash cookie value.
In case of cluster environment, that behavior will cause each clustered EAP instance has a different secret key. As a result, Mojarra is unable to restore clustered flash cookie value with the following error message: