This is an oversimplified example extracted from ThrustJS and it's server lib http to show the result when we try to use Apache Tomcat to serve an API, using Nashorn and GraalJS.
When we navigate to http://localhost:8778/servlet
using GraalJS we get an exception:
java.lang.IllegalStateException: Multi threaded access requested by thread Thread[http-nio-8778-exec-1,5,main] but is not allowed for language(s) js.
com.oracle.truffle.polyglot.PolyglotContextImpl.throwDeniedThreadAccess(PolyglotContextImpl.java:545)
com.oracle.truffle.polyglot.PolyglotContextImpl.checkAllThreadAccesses(PolyglotContextImpl.java:464)