|
|
|
|
|
|
Re: NEON Initialization Failed [message #1743983 is a reply to message #1743917] |
Wed, 21 September 2016 09:51 |
Ruediger Rensinghoff-Kranen Messages: 9 Registered: September 2016 |
Junior Member |
|
|
hi Judith,
thanks for your time you are spending on this problem.
We use single server.
Problematic are two apps on the same server with often sporadically and short logins and i think you could be right with the server problem.
In one of the apps i added BEANS.get(IPingService.class).ping("") on last friday as first action in Client.loadSession but also replaced ClientSessionRegistry without assert getUserId and since then it seems ok. But this is cosmetic.
From the other app you get some code that i think it is essential for this.
the Client looks like this
@Override
protected void execLoadSession() {
CODES.getAllCodeTypes("de.psgl.getn.shared");
getUserData();
setDesktop(new Desktop());
}
private UserData getUserData() {
if (userMap == null)
userMap = new HashMap<String, UserData>();
UserData data = null;
String u = getCurrentUserId();
if (!((u == null) || u.isEmpty())) {
data = userMap.get(u);
if (data == null) {
try {
data = BEANS.get(IAdminUserProcessService.class).getDataByUniqueKey(u);
if (data != null) userMap.put(u, data);
} catch (ProcessingException e) {
LOG.error("getUserData", e);
}
}
}
if (data == null)
data = new UserData(u == null ? "" : u);
return data;
}
public String getCurrentUserId() {
String s = getUserId();
if (s == null) {
s = BEANS.get(IAccessControlService.class).getUserIdOfCurrentSubject();
}
return s;
}
and the Server like this
@Override
protected void execLoadSession() {
getCurrentUserId();
LOG.info("created a new session for {}", getUserId());
validateVPN();
}
private UserSessionData getUserData() {
if (userMap == null)
userMap = new HashMap<String, UserSessionData>();
UserSessionData data = null;
String u = getCurrentUserId();
if (!((u == null) || u.isEmpty())) {
data = userMap.get(u);
if (data == null) {
try {
data = BEANS.get(IUserSessionService.class).getUserSessionData(u);
if (data != null) userMap.put(u, data);
} catch (ProcessingException e) {
LOG.error("getUserData", e);
}
}
}
if (data == null)
data = new UserSessionData(u == null ? "" : u);
return data;
}
public String getCurrentUserId() {
String userId = getUserId();
LOG.info("getCurrentUserId from getUserId() 1. " + userId);
String userId2 = BEANS.get(IAccessControlService.class).getUserIdOfCurrentSubject();
if (!userId.equals(userId2)) {
LOG.info("getCurrentUserId from getUserIdOfCurrentSubject() 2." + userId2);
userId = userId2;
// setSharedContextVariable("userId", String.class, userId); this line is normally active but was not on logged situation
}
return userId;
}
The logs from the day are complete so that you can inspect what was going on.
Because of the situation in the morning i redeployed at 10:26.
You have to know that the apps are running for years in this manner with rap and migrated allways to the new mode with no problems.
The code above is the result of experience that after a timeout of the ClientSession in tomcat often the information of wrong user appeared.
You can see in the server log that after a fresh installation ClientSession's start with an own ServerSession.
But after time getUserId is not getUserIdOfCurrentSubject and last but not least there is only the getUserData call from the ClientSession.
In tomcat you can see only one ServerSession.
For me it looks like the session handling on server becomes tied or with other words it could have something like a leak.
Rüdiger
-
Attachment: logs.zip
(Size: 70.36KB, Downloaded 172 times)
|
|
|
|
Re: NEON Initialization Failed [message #1744039 is a reply to message #1744033] |
Wed, 21 September 2016 15:57 |
Ruediger Rensinghoff-Kranen Messages: 9 Registered: September 2016 |
Junior Member |
|
|
hi Judith,
that was also my first idea three weeks ago, but meanwhile i'm sure that is not the reason.
But ok i use Database CredentialVerifier.
First and until now in a very stable app we use it with bean call to the server.
Verification works always with success. But i do my job for more than 30 years and hence i tested different opportunities.
So in this apps database configs were verified and tomcat jndi and meanwhile plain jdbc with a connection per signon is used.
By the way today i deployed also in the second app a version with ping at ClientSession.execLoadSession,
replace of ClientSessionRegistry and updating SharedContextVariable userId in ServerSession when neaded.
And until now it is running like a charm with a ServerSession per ClientSession.
Don't you think it is at time that you have a look at your code.
What i have learned in those years the best model has to prove in reality.
As additional information when server is in this disastrous condition with only one ServerSession we realised that there is a only working user and no other can signin.
If he signsoff an other user and only this one can signon. This pitiable server can only be terminated.
My thanks for your engagement.
Rüdiger
[Updated on: Wed, 21 September 2016 16:31] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 2.28917 seconds