Can't login in NGClient

Forum to discuss the new web client version of Servoy.

Can't login in NGClient

Postby marco.rossi » Fri Aug 09, 2019 3:08 pm

Hi all,
I'm using servoy 2019 (updated to the last available version. I'm trying to deploy an NGClient by exporting it from Servoy 2019 to an apache tomcat.
All works fine within the developer but when I deploy the application on tomcat and I run it, I can't pass the login phase.

The login form is shown but it can't procede in showing the first form. I tried also to bypass the password check by manually login but this not solves.

I get always this error.

Code: Select all
2019-08-09 12:53   authenticator   ERROR   com.servoy.j2db.util.Debug   Could not verify login via authenticator PRISMauthenticator       
org.jabsorb.serializer.MarshallException: bean com.servoy.j2db.dataprocessing.SwingFoundSet bean com.servoy.j2db.dataprocessing.Record bean com.servoy.j2db.scripting.ScriptEngine$ServoyTopLevelScope can't invoke getIds: No Context associated with current Thread
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:259) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at com.servoy.j2db.util.serialize.NativeObjectSerializer.marshall(NativeObjectSerializer.java:123) ~[j2db.jar:2019.6.2.3504]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper.toJSON(JSONSerializerWrapper.java:75) ~[j2db.jar:2019.6.2.3504]
at com.servoy.j2db.util.serialize.JSONConverter.convertToJSON(JSONConverter.java:65) ~[j2db.jar:2019.6.2.3504]
at com.servoy.j2db.server.main.Zq.run(Zq.java:10) [j2dbdev.jar:2019.6.2.3504]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_202]
Caused by: org.jabsorb.serializer.MarshallException: bean com.servoy.j2db.dataprocessing.Record bean com.servoy.j2db.scripting.ScriptEngine$ServoyTopLevelScope can't invoke getIds: No Context associated with current Thread
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:259) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:240) ~[jabsorb.jar:?]
... 9 more
Caused by: org.jabsorb.serializer.MarshallException: bean com.servoy.j2db.scripting.ScriptEngine$ServoyTopLevelScope can't invoke getIds: No Context associated with current Thread
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:232) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:240) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:240) ~[jabsorb.jar:?]
... 9 more
Caused by: java.lang.RuntimeException: No Context associated with current Thread
at org.mozilla.javascript.Context.getContext(Context.java:2468) ~[js.jar:?]
at org.mozilla.javascript.IdScriptableObject.newIdFunction(IdScriptableObject.java:909) ~[js.jar:?]
at org.mozilla.javascript.IdScriptableObject.initPrototypeMethod(IdScriptableObject.java:812) ~[js.jar:?]
at org.mozilla.javascript.IdScriptableObject.initPrototypeMethod(IdScriptableObject.java:805) ~[js.jar:?]
at org.mozilla.javascript.ImporterTopLevel.initPrototypeId(ImporterTopLevel.java:222) ~[js.jar:?]
at org.mozilla.javascript.IdScriptableObject$PrototypeValues.ensureId(IdScriptableObject.java:314) ~[js.jar:?]
at org.mozilla.javascript.IdScriptableObject$PrototypeValues.getNames(IdScriptableObject.java:263) ~[js.jar:?]
at org.mozilla.javascript.IdScriptableObject.getIds(IdScriptableObject.java:640) ~[js.jar:?]
at org.mozilla.javascript.ScriptableObject.getIds(ScriptableObject.java:1014) ~[js.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_202]
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:223) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:240) ~[jabsorb.jar:?]
at org.jabsorb.JSONSerializer.marshall(JSONSerializer.java:390) ~[jabsorb.jar:?]
at com.servoy.j2db.util.serialize.JSONSerializerWrapper$1.marshall(JSONSerializerWrapper.java:143) ~[j2db.jar:2019.6.2.3504]
at org.jabsorb.serializer.impl.BeanSerializer.marshall(BeanSerializer.java:240) ~[jabsorb.jar:?]
... 9 more


thank you
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 110
Joined: Sun Apr 12, 2015 9:33 pm

Re: Can't login in NGClient

Postby Andrei Costescu » Mon Aug 12, 2019 1:28 pm

What kind of arguments do you pass to the authenticator solution from the login solution?
I think it's trying to transform that into json (that basically supports primitives, arrays and objects (of primitives or other arrays/objects)) and fails there. You can't pass complex values from the login solution to the authenticator sol.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Can't login in NGClient

Postby kwpsd » Fri Aug 16, 2019 11:38 pm

Servoy version 8.3.2.3207
Servoy Server JRE version 1.8.0_181

We are having the exact same issue at a customer site (server only, no developer)...user logs in, but the application does not launch. User is stuck at the login screen. Other users at this site can successfully log on using different computers. How do we hunt this problem down?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: Can't login in NGClient

Postby Andrei Costescu » Mon Aug 19, 2019 9:16 am

@kwpsd: If you have no errors/exceptions in either in the browser's console (CTRL+Shift+I) or in the servoy server log file, then see what is different for that user account (I assume it's related to the user account not the comp. being used). What do you pass differently for that user between the login solution and authenticator (as compared to other users that work), or are you giving correct groups for that user or ... Something must be different in his/her case.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Can't login in NGClient

Postby patrick1569617634 » Sat Jan 18, 2020 2:00 am

Has there been any solution to this, in developer this works fine.

I have a solution set to must authenticate and a login solution. Login solution has a form with user/pass and login button.
Simplified code

Code: Select all
function Login_onClick() {
   var results = security.authenticate("authenticator_solution","authenticate",[email, password]);
}


in Authenticator solution
Code: Select all
function authenticate(email,password) {
  var user=VerifyUser(email,password);
  security.login(user.work_email,user.user_id,['users'])   
}


in developer, when I click the button I'm routed to the correct home page.
deployed in Apache Tomcat as NGClient - nothing happens. This code works fine in Smart Client
patrick1569617634
 
Posts: 6
Joined: Fri Sep 27, 2019 10:53 pm

Re: Can't login in NGClient

Postby patrick1569617634 » Sat Jan 18, 2020 2:07 am

More Information:
Servoy 2019.9
No errors in the Servoy logs or in the Browser
patrick1569617634
 
Posts: 6
Joined: Fri Sep 27, 2019 10:53 pm

Re: Can't login in NGClient

Postby Andrei Costescu » Mon Jan 20, 2020 1:42 pm

This doesn't seem to be related to the original issue of this thread.

However: did you check what VerifyUser and security.login return when deployed?
Maybe the war export/import end up not having all the needed information (about groups and/or what "VerifyUser" uses to check things).

You can use for example application.output('Output of ... is: ' + x, LOGGINGLEVEL.ERROR) to debug this via log statements and then check the log entries in the file or servoy admin page. (or use other log levels like warning and info + configure the loggers to show those as well).
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Can't login in NGClient

Postby patrick1569617634 » Tue Jan 21, 2020 12:32 am

Ok, I got this working, the problem was in the below lines (I turned on Trace in the servoy logs, and saw the error)

Code: Select all
    security.addUserToGroup(user.user_id,user.work_email);
    security.login(user.work_email,user.work_email,['users'])


The group 'users' did not exist in the servoy_groups table.
I updated code to populate with the correct group and everything worked

Code: Select all
    var groupName = getGroupName(user.group_id);
    security.addUserToGroup(user.user_id,groupName);
    security.login(user.work_email,user.user_id,[groupName])       


What's amazing is this code has been working in SmartClient for years, the application just worked around this.
patrick1569617634
 
Posts: 6
Joined: Fri Sep 27, 2019 10:53 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests

cron