# Can't login in NGClient

**URL:** <https://forum.servoy.com/t/cant-login-in-ngclient/20057>\
**Category:** Classic Servoy\
**Created:** [August 9, 2019, 1:08pm UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057 "2019-08-09T13:08:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marco.rossi](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@marco.rossi](https://forum.servoy.com/u/marco.rossi)\
**Post date:** [August 9, 2019, 1:08pm UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/1 "2019-08-09T13:08:58Z")

</div>

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.

```auto
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

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [August 12, 2019, 11:28am UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/2 "2019-08-12T11:28:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kwpsd](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kwpsd](https://forum.servoy.com/u/kwpsd)\
**Post date:** [August 16, 2019, 9:38pm UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/3 "2019-08-16T21:38:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [August 19, 2019, 7:16am UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/4 "2019-08-19T07:16:37Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![patrick1569617634](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@patrick1569617634](https://forum.servoy.com/u/patrick1569617634)\
**Post date:** [January 18, 2020, 12:00am UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/5 "2020-01-18T00:00:31Z")

</div>

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

```auto
function Login_onClick() {
	var results = security.authenticate("authenticator_solution","authenticate",[email, password]);
}

```

in Authenticator solution

```auto
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

---

<div class="post-metadata">

**Author:** ![patrick1569617634](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@patrick1569617634](https://forum.servoy.com/u/patrick1569617634)\
**Post date:** [January 18, 2020, 12:07am UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/6 "2020-01-18T00:07:02Z")

</div>

More Information:  
Servoy 2019.9  
No errors in the Servoy logs or in the Browser

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [January 20, 2020, 11:42am UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/7 "2020-01-20T11:42:42Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![patrick1569617634](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@patrick1569617634](https://forum.servoy.com/u/patrick1569617634)\
**Post date:** [January 20, 2020, 10:32pm UTC](https://forum.servoy.com/t/cant-login-in-ngclient/20057/8 "2020-01-20T22:32:02Z")

</div>

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

```auto
    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

```auto
    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.
