Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

NoSuchMethodException parameter binding remoting

I am getting this NoSuchMethodException due to a problem with parameter type binding on remote methods. I have an overloaded method with different signatures, but the same number of arguments. In the SpaceRemotingServiceExporter, instead of binding according to the number of arguments to bind methods and then by exact parameter type matching. I think binding should work the same way it does in java -- look for the most specific matching method.

[some stack frames deleted] Caused by: org.springframework.remoting.RemoteLookupFailureException: Failed to find method [find] for lookup [com.patentvest.datagrid.gigaspaces.processing.GridQueryService]; nested exception is java.lang.NoSuchMethodException: com.patentvest.datagrid.gigaspaces.processing.GigaspaceQueryService.find(java.lang.Class, com.patentvest.datagrid.gigaspaces.processing.BinaryCriterion) at org.openspaces.remoting.SpaceRemotingServiceExporter$RemotingServiceInvoker.process(SpaceRemotingServiceExporter.java:404) at com.j_spaces.obf.pq.a(SourceFile:673) at com.j_spaces.obf.pq.a(SourceFile:637) at com.j_spaces.obf.pq.a(SourceFile:616) at com.j_spaces.obf.pq.a(SourceFile:588) at com.j_spaces.obf.pv.readMultiple(SourceFile:1974) at com.j_spaces.core.JSpaceImpl.readMultiple(SourceFile:1591) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.j_spaces.obf.ne.a(SourceFile:332) at com.j_spaces.obf.hq.a(SourceFile:437) at com.j_spaces.obf.hq.a(SourceFile:525) at com.j_spaces.obf.ov.work(SourceFile:174) at com.j_spaces.obf.od.a(SourceFile:211) at com.j_spaces.obf.od.dispatch(SourceFile:201) at com.j_spaces.obf.de.run(SourceFile:62) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoSuchMethodException: com.patentvest.datagrid.gigaspaces.processing.GigaspaceQueryService.find(java.lang.Class, com.patentvest.datagrid.gigaspaces.processing.BinaryCriterion) at java.lang.Class.getMethod(Class.java:1605) at org.openspaces.remoting.SpaceRemotingServiceExporter$MethodInvocationCache.findMethod(SpaceRemotingServiceExporter.java:516) at org.openspaces.remoting.SpaceRemotingServiceExporter$RemotingServiceInvoker.process(SpaceRemotingServiceExporter.java:402) ... 20 more h4. Attachments

[remoting-overriding-sample.zip|/upfiles/13759718429268636.zip]

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2418]{quote}

asked 2008-06-26 16:34:16 -0500

larrychu gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

can you please attach the pu.XML file, service interface and service impl?

Edited by: Uri Cohen on Jun 26, 2008 4:58 PM h4. Attachments

[remoting-overriding-sample.zip|/upfiles/13759718429319756.zip]

answered 2008-06-26 16:58:05 -0500

uri gravatar image
edit flag offensive delete link more

Comments

I think i have included all the relevant files in the attached zip. Let me know if there is anything missing.

Thanks, Larry

Edited by: Larry Chu on Jun 27, 2008 11:31 AM Sorry: I updated the zip samples because I had originally attached the wrong version of those files. h4. Attachments

[remoting-overriding-sample.zip|/upfiles/13759718427611675.zip]

larrychu gravatar imagelarrychu ( 2008-06-27 10:35:00 -0500 )edit

Sorry about the grammatical mistakes in my first post. I'll try to explain the problem better:

We have an interface with two methods with the same number of arguments:

interface GridService { void doSomething(A a, B b); void doSomething(A a, C c); }

where C is an interface:

interface C { ... }

When we remote this and try to call the method remotely, the service exporter (or cache) attempts to bind to the server method according to the types passed by the client. The client call would look something like this:

A a = new A(); C c = new ConcreteC(); new GridServiceImpl().doSomething(a, c);

where ConcreteC is a class which implements C.

class ConcreteC implements C...

We get NoSuchMethodException because the ServiceExporter cache calls Class.getMethod() -- which uses exact type matching -- by passing the concrete types of the arguments sent by the client rather than attempting to do what I would have expected -- a Java-like method signature binding.

Edited by: Larry Chu on Jun 27, 2008 10:46 AM

larrychu gravatar imagelarrychu ( 2008-06-27 10:46:18 -0500 )edit

Sorry, in the files i posted, I had already renamed the methods to prevent the NoSuchMethodException: If you rename the "filter" method to "find" in GridQueryService (and implementation) to:

public interface GridQueryService { <t> int[] find(Class<t> entityClass, Specification<t> specification);

<T> int[] find(Class<T> entityClass, Criterion criterion);

}

you'll find the error.

larrychu gravatar imagelarrychu ( 2008-06-27 11:30:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-06-26 16:34:16 -0500

Seen: 50 times

Last updated: Aug 08 '13