NEON Initialization Failed [message #1743566] |
Fri, 16 September 2016 08:40  |
Eclipse User |
|
|
|
since several years we are very happy with scout.
But also we know for years with scout and rap that getUserId infrequently was failing.
Until Mars the solution was ClientSyncJob.getCurrentSession().getUserId() and SERVICES.getService(IAccessControlService.class).getUserIdOfCurrentSubject() and verifing or not using SharedContextVariable.
But since NEON leads missing of userId as SharedContextVariable to this error. And controlling and setting on ServerSession.loadSession does not grip anymore.
2016-09-16 10:48:44,175 ERROR [ajp-nio-8009-exec-2] org.eclipse.scout.rt.ui.html.json.JsonMessageRequestHandler - Error while initializing UI session - MDC[principal=Hommel, httpUri=/getn1015/json, cid=ju8tg4sp7yq/1]
org.eclipse.scout.rt.platform.util.Assertions$AssertionException: Assertion error: No userId available [user=Hommel, calling-thread=ajp-nio-8009-exec-2, job=Starting ClientSession [sessionId=efefccd6-a636-4065-bdd0-ca6aadfc6e82]]
at org.eclipse.scout.rt.platform.util.Assertions.fail(Assertions.java:580)
at org.eclipse.scout.rt.platform.util.Assertions.assertNotNull(Assertions.java:87)
at org.eclipse.scout.rt.client.clientnotification.ClientSessionRegistry.checkSession(ClientSessionRegistry.java:105)
at org.eclipse.scout.rt.client.clientnotification.ClientSessionRegistry.sessionStarted(ClientSessionRegistry.java:98)
at org.eclipse.scout.rt.client.clientnotification.ClientSessionRegistry.sessionChanged(ClientSessionRegistry.java:223)
at org.eclipse.scout.rt.client.AbstractClientSession.fireSessionChangedEvent(AbstractClientSession.java:646)
at org.eclipse.scout.rt.client.AbstractClientSession.start(AbstractClientSession.java:328)
at org.eclipse.scout.rt.client.session.ClientSessionProvider$1$1.call(ClientSessionProvider.java:81)
at org.eclipse.scout.rt.client.session.ClientSessionProvider$1$1.call(ClientSessionProvider.java:1)
at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:185)
at org.eclipse.scout.rt.platform.context.RunContextRunner$1.call(RunContextRunner.java:42)
at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:185)
at org.eclipse.scout.rt.platform.security.SubjectProcessor$1.run(SubjectProcessor.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.eclipse.scout.rt.platform.security.SubjectProcessor.intercept(SubjectProcessor.java:43)
at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:180)
at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:135)
at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:121)
at org.eclipse.scout.rt.platform.context.RunContextRunner.intercept(RunContextRunner.java:38)
at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:180)
at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:135)
at org.eclipse.scout.rt.platform.job.internal.JobFutureTask$1.call(JobFutureTask.java:100)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.run(JobFutureTask.java:160)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.eclipse.scout.rt.platform.job.internal.NamedThreadFactory$1.run(NamedThreadFactory.java:54)
This never happens after fresh deployment but after time frequently, hence it becomes a problem.
Apps runing on Ubuntu 14.04, Apache Tomcat/8.0.36, java-8-oracle/jre1.8.0_66-b17.
A rapid response would be appreciated.
Rüdiger
|
|
|
|
|
|
|
|
Re: NEON Initialization Failed [message #1743983 is a reply to message #1743917] |
Wed, 21 September 2016 05:51   |
Eclipse User |
|
|
|
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 195 times)
|
|
|
|
|
|
|
|
|
|
Re: NEON Initialization Failed [message #1748764 is a reply to message #1748757] |
Mon, 28 November 2016 08:22  |
Eclipse User |
|
|
|
hi Luka,
meanwhile we follow the guideline from Judith and deploy only one Scout NEON Client in a tomcat server. For me now this is the straight running way. But you can also have a look on what i did before to get it run.
Rüdiger
|
|
|
Powered by
FUDForum. Page generated in 0.27449 seconds