Shared Variables Error [message #1844940] |
Thu, 30 September 2021 06:48  |
Eclipse User |
|
|
|
Hi all
We have 2 things that we need to share with the Client and Server. I did that with Shared Variables.
But the problem now is they wont load on the ClientSession anymore and therefore it fails when i want to log in.
This is the ClientSession Code
@Override
protected void execLoadSession() {
// initialize variables from server session to prevent crash while loading client session(this
// is needed bc theres more than 1 shared variable in context)
initializeSharedVariables();
// pre-load all known code types
CODES.getAllCodeTypes("SHARED PACKAGE");
// The locale needs to be set before the Desktop is created.
String localeString =
ClientUIPreferences.getClientPreferences(get()).get(PREF_USER_LOCALE, null);
if (localeString != null) {
setLocale(Locale.forLanguageTag(localeString));
}
LOG.info("created a new Client session for {}", getUserId());
LOG.info("CLIENT EMPLOYEE ID IS {}", getSessionUser());
LOG.info("CLIENT EMPLOYEE ROLES ARE {}", getEmployeeSessionRoles());
ISettingsPageService service = BEANS.get(ISettingsPageService.class);
Boolean dense = service.getViewSetting(getSessionUser().getEmployeeId());
// false == light
Boolean view = service.getThemeSetting(getSessionUser().getEmployeeId());
setDesktop(getDesktopForUserRoles(dense, view));
service.updateEmployeeLoggin(getSessionUser().getEmployeeId());
}
The LOGS of the Clientsession all say the shared Variables are null. Therefore my service fail too :/
This the Serversession Code
@Override
protected void execLoadSession() {
UserPojo user = loadEmployeeSessionId(getUserId());
setSessionUser(user);
List<Roles> employeeRoles = loadEmployeeRoles(user.getEmployeeId());
setEmployeeSessionRoles(employeeRoles);
LOG.info("USER IS: " + user);
LOG.info("created a new server session for {}", getUserId());
LOG.info("SERVER EMPLOYEE ID IS {}", getSessionUser().getEmployeeId());
LOG.info("SERVER EMPLOYEE ROLES ARE {}", getEmployeeSessionRoles());
}
Did something change in Scout 11? This worked before. Does anyone know a fix?
Thanks in advance :)
|
|
|
Re: Shared Variables Error [message #1844941 is a reply to message #1844940] |
Thu, 30 September 2021 07:05  |
Eclipse User |
|
|
|
Ok it seems i found a workaround. The problem seems to be the initializeSharedVariables() , cause that doesnt work. I fixed it with creating my own service that does nothing.
@Override
public void clientSessionSharedVariablesInit(String s) {
}
Then the shared Variables get initialized.
Maybe this is a Scout bug?
[Updated on: Thu, 30 September 2021 07:18] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04072 seconds