# RestWSPlugin: Constructor for "String" not found.

**URL:** <https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976>\
**Category:** Classic Servoy\
**Created:** [May 13, 2019, 2:34pm UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976 "2019-05-13T14:34:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [May 13, 2019, 2:34pm UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/1 "2019-05-13T14:34:23Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 15, 2019, 9:15am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/2 "2019-05-15T09:15:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [May 15, 2019, 9:25am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/3 "2019-05-15T09:25:57Z")

</div>

We are on Version: 6.0.10 - build 1240.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 15, 2019, 10:33am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/4 "2019-05-15T10:33:34Z")

</div>

this seems to be related (and fixed) with: [https://support.servoy.com/browse/SVY-11352](https://support.servoy.com/browse/SVY-11352)

But this is a side effect of [https://support.servoy.com/browse/SVY-7201](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 )

---

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [May 15, 2019, 11:04am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/5 "2019-05-15T11:04:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 15, 2019, 11:10am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/6 "2019-05-15T11:10:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [May 15, 2019, 11:18am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/7 "2019-05-15T11:18:10Z")

</div>

rest\_ws\_plugin\_client\_pool\_exhausted\_action: Grow  
PoolSize: 10

Clients at peak moments can vary from 100 till 1000+

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [May 15, 2019, 11:36am UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/8 "2019-05-15T11:36:13Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Janssenjos](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Janssenjos](https://forum.servoy.com/u/Janssenjos)\
**Post date:** [May 15, 2019, 2:03pm UTC](https://forum.servoy.com/t/restwsplugin-constructor-for-string-not-found/19976/9 "2019-05-15T14:03:00Z")

</div>

Thanks, we will try that!
