Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default value for com.sun.faces.clientStateTimeout is invalid #4743

Closed
vsvetoslavov opened this issue Sep 29, 2020 · 2 comments
Closed
Labels

Comments

@vsvetoslavov
Copy link

vsvetoslavov commented Sep 29, 2020

The constructor in WebConfiguration for the ClientStateTimeout value defines the default value as "".
The init() method of ClientSideStateHelper, however, contains the following:

  stateTimeoutEnabled = webConfig.isSet(ClientStateTimeout);
     if (stateTimeoutEnabled) {
         String timeout = webConfig.getOptionValue(ClientStateTimeout);
         try {
             stateTimeout = Long.parseLong(timeout);
         } catch (NumberFormatException nfe) {
             stateTimeout = Long.parseLong(ClientStateTimeout.getDefaultValue());
         }
     }

So if the value in the web.xml is invalid, an attempt is made to read "" as Long, which in turn results in NumberFormatException.
The above behaviour is present in 2.3.9.SP03 (WildFly 18.0.0). The code for 2.3.9.SP11 seems like that as well but I haven't tested with that version.
Browsing further I realized that there is no way to define a value for clientStateTimeout such that there will be no timeout (similar to the behaviour if there is no value defined in web.xml). This also seems wrong - it would be good if one is able to explicitly disable the timeout.
The same issue is described also here:
jboss/mojarra#78

@mnriem mnriem added the 2.3 label Nov 27, 2021
@BalusC
Copy link
Contributor

BalusC commented Feb 20, 2022

Reproduced.

BalusC added a commit that referenced this issue Feb 20, 2022
as well as explicitly disabling com.sun.faces.clientStateTimeout when
resolved value is negative
@BalusC
Copy link
Contributor

BalusC commented Feb 20, 2022

Fixed in #5049. It will now:

  • disable the client state timeout when resolved context param has a negative value
  • disable the client state timeout and log a warning when resolved context param is not parseable as long

arjantijms added a commit that referenced this issue Feb 20, 2022
#4743: Fix deploy fail when com.sun.faces.clientStateTimeout is invalid
@BalusC BalusC closed this as completed May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants