Nikolay Izhikov created IGNITE-13931:
----------------------------------------
Summary: .NET: Service can't assign correct type to passed array
parameters (.Net -> .Net call)
Key: IGNITE-13931
URL: https://issues.apache.org/jira/browse/IGNITE-13931
Project: Ignite
Issue Type: Bug
Components: platforms
Affects Versions: 2.9
Reporter: Yaroslav Molochkov
Assignee: Nikolay Izhikov
Fix For: 2.10
This issue relates to IGNITE-12823.
Ignite client calls deployed service and fails with the following exception:
{code:java}
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)
{code}
Service interface itself looks like this:
{code:java}
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;
}
}
{code}
And the call to the service:
{code:java}
var svc = igniteServices.GetServiceProxy<T>(name, false);
var result = svc.processSomething(id, parameters);
{code}
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)