Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-6300

Parameters, CacheManager and Marshaller are not passed to JavaScript in case of mode=distributed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 9.0.0.Alpha2, 9.0.0.Final
    • 8.1.2.Final
    • Tasks
    • None

    Description

      When in javascript file the mode is set to distributed, the cacheManager, marshaller and parameters are not passed from the server.

      // mode=distributed,language=javascript,parameters=[a]
      cache.put("a", a)
      cacheManager.getAddress()
      

      Java Call:

            CompletableFuture<ArrayList<JGroupsAddress>> resultsFuture = scriptingManager.runScript("distExec.js", new TaskContext().cache(cache(0)).addParameter("a", "value"));
      

      The following line execution throws:

      Caused by: <eval>:3 ReferenceError: "a" is not defined  
      or 
      "cacheManager" is not defined if the cache put is commented. 
      

      UPDATE:

      When the same script is run using on Hotrod Server via Hotrod client, the following exception is thrown:

      org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=53 returned server error (status=0x85): java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ExecTest-NodeA-26018, see cause for remote stack trace
      java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ExecTest-NodeA-26018, see cause for remote stack trace
      org.infinispan.remoting.RemoteException: ISPN000217: Received exception from ExecTest-NodeA-26018, see cause for remote stack trace
      org.infinispan.commons.marshall.NotSerializableException: jdk.nashorn.api.scripting.ScriptObjectMirror
      an exception which occurred:
      	in field ecmaError
      	in field cause
      	in field cause
      	in object org.infinispan.commons.CacheException@5f8d3629
      		-> toString = org.infinispan.commons.CacheException: ISPN026003: Script execution error
      	in object org.infinispan.remoting.responses.ExceptionResponse@19da5d4b
      		-> toString = ExceptionResponse
      
      	at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:343)
      	at org.infinispan.client.hotrod.impl.protocol.Codec20.readPartialHeader(Codec20.java:132)
      	at org.infinispan.client.hotrod.impl.protocol.Codec20.readHeader(Codec20.java:118)
      	at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:56)
      	at org.infinispan.client.hotrod.impl.operations.ExecuteOperation.executeOperation(ExecuteOperation.java:49)
      	at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:54)
      	at org.infinispan.client.hotrod.impl.RemoteCacheImpl.execute(RemoteCacheImpl.java:703)
      	at org.infinispan.client.hotrod.ExecTest.testScriptExecutionWithPassingParams(ExecTest.java:119)
      	...
      

      Attachments

        Issue Links

          Activity

            People

              rh-ee-galder Galder ZamarreƱo
              amanukya@redhat.com Anna Manukyan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: