[x3d-public] DISWebGateway

John Carlson yottzumm at gmail.com
Sun Feb 21 20:55:25 PST 2021


This looks useful, getting nashorn working in Java 15.


https://quabr.com/65265629/how-to-use-nashorn-in-java-15-or-later


Basically, you have to add a jar to your classpath it looks like!


John

On 2/21/21 10:37 PM, John Carlson wrote:
> This code works in GraalVM.
>
>
> import javax.script.ScriptEngine;
> import javax.script.ScriptEngineManager;
> public class Foo {
>      static public void main(String [] args) {
>
>      try
>       {
>         ScriptEngineManager factory = new ScriptEngineManager();
>         ScriptEngine engine = factory.getEngineByName("nashorn");
>
>         engine.eval("print('Hello, World')");
>
>       }
>       catch(Exception e)
>       {
>           System.out.println(e);
>       }
>
>         }
> }
>
> ================================================================
>
> This code does not work in DISWebGateway.  Can i get a Java version # 
> when running the run target under ant?
>
>
> $ sudo ant run
>
> This is a Linux 5.8 system.
>
>
> See below
>
>
>
> On 2/21/21 9:53 PM, John Carlson wrote:
>> I've been trying to get open-dis' DISWebGateway running, and got the 
>> following script issue. I think it's because OpenJDK does not use a 
>> scripting engine like Nashorn.
>>
>>
>> I will likely move to GraalVM if there are no other solutions.
>>
>>
>> run:
>>      [java] Loaded configuration properties
>>      [java] class edu.nps.moves.gateway.Configuration
>>      [java] SLF4J: Failed to load class 
>> "org.slf4j.impl.StaticLoggerBinder".
>>      [java] SLF4J: Defaulting to no-operation (NOP) logger 
>> implementation
>>      [java] SLF4J: See 
>> http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
>>      [java] Started DIS listening on UDP port 1194
>>      [java] Configured to not use redis server
>>      [java] Starting websocket server on TCP port 8282
>>      [java] Starting https server on TCP port 443
>>      [java] WebSocket Opened
>>      [java] java.lang.NullPointerException: Cannot invoke 
>> "javax.script.ScriptEngine.eval(String)" because "engine" is null
>>      [java] WebSocket Closed. Code:1011 Reason:WebSocketException
>>      [java] WebSocket Opened
>>      [java] java.lang.NullPointerException: Cannot invoke 
>> "javax.script.ScriptEngine.eval(String)" because "engine" is null
>>      [java] WebSocket Closed. Code:1011 Reason:WebSocketException
>>



More information about the x3d-public mailing list