Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Shared Variables Error(Scout 11 shared Variables Error)
Shared Variables Error [message #1844940] Thu, 30 September 2021 10:48 Go to next message
Luis Nothvogel is currently offline Luis NothvogelFriend
Messages: 56
Registered: October 2019
Member
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 11:05 Go to previous message
Luis Nothvogel is currently offline Luis NothvogelFriend
Messages: 56
Registered: October 2019
Member
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 11:18]

Report message to a moderator

Previous Topic:It is possible to implement an offline client Session with Scout
Next Topic:SonarQube Settings for Scout
Goto Forum:
  


Current Time: Wed Dec 11 22:36:47 GMT 2024

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

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

Back to the top