Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Empty ClientPreferences in ClientSession.execLoadSession after logout and re-login
Empty ClientPreferences in ClientSession.execLoadSession after logout and re-login [message #1800030] Wed, 19 December 2018 03:33 Go to next message
Eclipse UserFriend
Hello.

I have this problem:

I have execLoadSession in ClientSession class:
public class ClientSession extends AbstractClientSession {
...
	@Override
	protected void execLoadSession() {
		// pre-load all known code types
		CODES.getAllCodeTypes("cz.gpe.per.portal.app.shared");

		// The locale needs to be set before the Desktop is created.
	    String localeString = ClientUIPreferences.getClientPreferences(ClientSession.get()).get(PREF_USER_LOCALE, null);
	    LOG.info("localeString: " + (localeString == null ? "!!! NULL !!!" : localeString));
	    if (localeString != null) {
	      Locale userLocale = LocaleUtility.parse(localeString);
	      setLocale(userLocale);
	    }
	    
		setDesktop(new Desktop());
	
	}


If I login after server restart, "localeString" contains right value (i.e. "cs_CZ" or "en_US"), but if I logout and then login again (without server restart), then "localeString" is null (ClientPreferences has no elements).

Could someone advise me?
Thank you.
Re: Empty ClientPreferences in ClientSession.execLoadSession after logout and re-login [message #1800065 is a reply to message #1800030] Wed, 19 December 2018 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Addition:

CientSesion.get() is null in this situation (login again after logout without server restart).

It seems that execLoadSession is called before ClientSession is initialized. But after server restart is that called after ClientSession initialize.

Where do I make a mistake, please? Thanx.
Re: Empty ClientPreferences in ClientSession.execLoadSession after logout and re-login [message #1800082 is a reply to message #1800065] Wed, 19 December 2018 11:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi Miloslav

I have not tested it, just guessing: Does it make a difference if you use the current instance (this) instead ClientSession.get()?
Re: Empty ClientPreferences in ClientSession.execLoadSession after logout and re-login [message #1800083 is a reply to message #1800082] Wed, 19 December 2018 11:36 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your interest, but my problem solved adding line:
initializeSharedVariables();

public class ClientSession extends AbstractClientSession {
...
	@Override
	protected void execLoadSession() {
		// pre-load all known code types
		CODES.getAllCodeTypes("cz.gpe.per.portal.app.shared");

		initializeSharedVariables();		// <<< THIS SOLVED MY PROBLEM

		// The locale needs to be set before the Desktop is created.
	    String localeString = ClientUIPreferences.getClientPreferences(ClientSession.get()).get(PREF_USER_LOCALE, null);
	    LOG.info("localeString: " + (localeString == null ? "!!! NULL !!!" : localeString));
	    if (localeString != null) {
	      Locale userLocale = LocaleUtility.parse(localeString);
	      setLocale(userLocale);
	    }
	    
		setDesktop(new Desktop());
	
	}
Re: Empty ClientPreferences in ClientSession.execLoadSession after logout and re-login [message #1800195 is a reply to message #1800083] Fri, 21 December 2018 03:25 Go to previous message
Eclipse UserFriend
Ok, thank you for sharing the solution with us!
Previous Topic:How to track down an error thrown in the javascript code?
Next Topic:Deployment fails
Goto Forum:
  


Current Time: Fri Jun 13 16:22:37 EDT 2025

Powered by FUDForum. Page generated in 0.05716 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top