Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13931

.NET: Service can't assign correct type to passed array parameters (.Net -> .Net call)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9
    • 2.10
    • platforms
    • Docs Required, Release Notes Required

    Description

      This issue relates to IGNITE-12823.

      Ignite client calls deployed service and fails with the following exception:

      Apache.Ignite.Core.Common.JavaException: class org.apache.ignite.IgniteException: Failed to invoke proxy: there is no method 'processSomething' in type 'SomeService' with (Int32, Object[]) arguments
      	at org.apache.ignite.internal.processors.platform.callback.PlatformCallbackUtils.inLongOutLong(Native Method)
      	at org.apache.ignite.internal.processors.platform.callback.PlatformCallbackGateway.serviceInvokeMethod(PlatformCallbackGateway.java:942)
      	at org.apache.ignite.internal.processors.platform.services.PlatformAbstractService.invokeMethod(PlatformAbstractService.java:214)
      	at org.apache.ignite.internal.processors.platform.services.PlatformAbstractService.invokeMethod(PlatformAbstractService.java:185)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.ignite.internal.processors.service.GridServiceProxy$ServiceProxyCallable.callService(GridServiceProxy.java:491)
      	at org.apache.ignite.internal.processors.service.GridServiceProxy$ServiceProxyCallable.call(GridServiceProxy.java:469)
      	at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1847)
      	at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:598)
      	at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:7077)
      	at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:592)
      	at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:521)
      	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
      	at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1368)
      	at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:2130)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1907)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1528)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.access$5300(GridIoManager.java:241)
      	at org.apache.ignite.internal.managers.communication.GridIoManager$9.execute(GridIoManager.java:1421)
      	at org.apache.ignite.internal.managers.communication.TraceRunnable.run(TraceRunnable.java:55)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      Service interface itself looks like this:

      public interface SomeService : IService
      {
          int processSomething(int foo, Parameter[] parameters);
      
          int processSomething(int foo, int bar);
      }
      
      public class Parameter
{
    
          private int id;
    
          private ParamValue[] _values;

    
          public Parameter(int id, ParamValue[] _values)
    {
 
             this.id = id;
        
             this._values = _values;
    
          }
      
}
      
      

public class ParamValue
{

          private int id;
    
          private double val;

    
          public ParamValue(int id, double val)
    {
 
             this.id = id;
       
             this.val = val;
  
          }
      
}
      
      

      And the call to the service:

      var svc = igniteServices.GetServiceProxy<T>(name, false);
      var result = svc.processSomething(id, parameters);
      

      Please note, that if there's no overloaded methods, at least in our experiments we found out that it does reproduce with equal number of parameters in overloaded methods (e.g. here we have overloaded methods that take 2 parameters each), then the code works like a charm.

      Fix in IGNITE-12823 addresses particular code execution path where the execution flow goes through PlatformServices class. Yet in this case our code goes through PlatformAbstractService. I think that the fix of casting arrays should be positioned a little bit lower in the call stack (or higher in code hierarchy) so all execution paths are covered simultaneously. 

      Attachments

        Issue Links

          Activity

            People

              nizhikov Nikolay Izhikov
              YAMolochkov Yaroslav Molochkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h