简体   繁体   English

Websphere 8 集群和 JSF2 问题

[英]Websphere 8 cluster and JSF2 issue

I'm currently programming with JSF on Websphere 8.0 and am running into an issue and I think it's because of our clustering.我目前正在 Websphere 8.0 上使用 JSF 进行编程,遇到了一个问题,我认为这是因为我们的集群。 We have two nodes and after one was down for some time, my problem was not occurring.我们有两个节点,其中一个节点停机一段时间后,我的问题没有发生。

My problem is that my after submitting with through a commandButton ends in an javax.faces.application.ViewExpiredException.我的问题是我在通过 commandButton 提交后以 javax.faces.application.ViewExpiredException 结束。

Also in a stacktrace before this I found this:在此之前的堆栈跟踪中,我还发现了这一点:

View State cannot be reconstructed
javax.faces.FacesException: javax.faces.application.ViewExpiredException
    at org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:496)
    at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:378)

So I guess there is something wrong with the handling between the two nodes.所以我猜想两个节点之间的处理有问题。

In my web.xml I have set:在我的 web.xml 中,我设置了:

<distributable />

and

<env-entry>
        <env-entry-name>jsf/ClientSideSecretKey</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>SRe1FY2HKwBTOtT5KrtmiSoOzws+NA9/yX191wMFn9o=</env-entry-value>
    </env-entry> 

like some other mentioned in other threads, but my issue still remains.就像其他线程中提到的其他一些一样,但我的问题仍然存在。

Is there maybe some configuration to be made inside Websphere?在 Websphere 中可能需要进行一些配置吗?

This points to an encryption issue.这指向一个加密问题。 WebSphere 8.0 uses the MyFaces JSF 2.0 implementation - it's likely that you need to configure a shared secret for each of your nodes via the MyFaces context parameters. WebSphere 8.0 使用 MyFaces JSF 2.0 实现——您可能需要通过 MyFaces 上下文参数为每个节点配置共享机密。 At minimum, you will need to set the org.apache.myfaces.SECRET parameter:至少,您需要设置 org.apache.myfaces.SECRET 参数:

<!-- Defines the secret (Base64 encoded) used to initialize the secret key
     for encryption algorithm. The size of it depends on the algorithm used for encryption -->
<context-param>
    <param-name>org.apache.myfaces.SECRET</param-name>
    <param-value>MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIz</param-value>
</context-param>

An explanation of MyFaces security parameters is here .此处为 MyFaces 安全参数的说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM