Page 1 of 1

RestWSPlugin: Constructor for "String" not found.

PostPosted: Mon May 13, 2019 4:34 pm
by Janssenjos
In the ~/servoy-admin/log we are having these kind of errors, we can't address.
Everything runs fine, until these errors start happening for some unknow reason. Then we have to restart the server. We can't reproduce it, how it happens.

How can we trace/see what is happening here, so we can find an solution?
Or what does the exception mean?

ERROR
com.servoy.extensions.plugins.rest_ws.RestWSPlugin
- No ClientID
- No Sulution name

Code: Select all
org.mozilla.javascript.EvaluatorException: Constructor for "String" not found. (ws_create#22)
       at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:114)
       at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1077)
       at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1126)
       at org.mozilla.javascript.Context.reportRuntimeError1(Context.java:1094)
       at org.mozilla.javascript.ScriptRuntime.getExistingCtor(ScriptRuntime.java:1212)
       at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:1017)
       at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:977)
       at org.mozilla.javascript.ScriptRuntime.toObjectOrNull(ScriptRuntime.java:949)
       at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2113)
       at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3481)
       at script.ws_create(ws_create:22)
       at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
       at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
       at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
       at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3135)
       at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
       at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:537)
       at com.servoy.j2db.FormController.executeFunction(FormController.java:4074)
       at com.servoy.j2db.FormController.executeFunction(FormController.java:3946)
       at com.servoy.j2db.plugins.ClientPluginAccessProvider$MethodExecutor.run(ClientPluginAccessProvider.java:551)
       at com.servoy.j2db.server.headlessclient.SessionClient.invokeAndWait(SessionClient.java:1209)
       at com.servoy.j2db.plugins.ClientPluginAccessProvider$1.run(ClientPluginAccessProvider.java:445)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       at java.base/java.lang.Thread.run(Thread.java:834)

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 11:15 am
by jcompagner
What version of servoy are you using here?
There are fixes for that in the latest releases, because it seems that the solution is already closed but code is still running.

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 11:25 am
by Janssenjos
We are on Version: 6.0.10 - build 1240.

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 12:33 pm
by jcompagner
this seems to be related (and fixed) with: https://support.servoy.com/browse/SVY-11352

But this is a side effect of https://support.servoy.com/browse/SVY-7201 that we close the solution between request.
But i think we didn't really do that yet in 6.0.10 (see SVY-7201 mentioning that)

Are you calling close() in the solution your self?

But we can't do much for this for 6.0.10. Because of all the changes that where needed also in core (you can't i think just use a restws plugin of 8.x )

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 1:04 pm
by Janssenjos
Are you calling close() in the solution your self?

Not in the REST plugin calls, where we suspect that it happens. We have a seperate solution on the same server wich does use close on the solution, but we experience problems with the REST calls.

this seems to be related (and fixed)

How can we be certain it is related?

Because it's not like something that always happens. The calls work fine, but after a while it seems to loose it's way.

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 1:10 pm
by jcompagner
yes when the load is higher, or when multiply things happen at the same time
The error is exactly the same as that case, something is references (and running) in an already closed client.

Maybe you can make the pool size a lot bigger. How many rest clients are open?

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 1:18 pm
by Janssenjos
rest_ws_plugin_client_pool_exhausted_action: Grow
PoolSize: 10

Clients at peak moments can vary from 100 till 1000+

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 1:36 pm
by jcompagner
and i think this is the problem with "grow"
that means if it is busy it will keep growing and then go down to 10 and those that go to 10 will be closed (but somehow also reused it seems)
so maybe you can configure it to not let it grow (but block) and then having a fixed poolsize that is lager then 10 (maybe 100)

Re: RestWSPlugin: Constructor for "String" not found.

PostPosted: Wed May 15, 2019 4:03 pm
by Janssenjos
Thanks, we will try that!