Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get "method not found" error when JsonRpcMethod.value != method.name #289

Open
drghood opened this issue May 31, 2022 · 0 comments
Open

Comments

@drghood
Copy link

drghood commented May 31, 2022

when i directly annotation on Class without any interfaces, like below, when request 'rawMethodName' method with {"method": "differentMethodName"} it work properly:

@Service  
@JsonRpcService("sample")  
@AutoJsonRpcServiceImpl  
public class SampleApi{  
	@JsonRpcMethod("differentMethodName")  
	public Object rawMethodName(Object args) {  
		//some code  
	}  
}  

but when i put some none business interfaces implements on Class,like below, when request 'rawMethodName' method with {"method": "differentMethodName"} it GET "method not found":

@Service  
@JsonRpcService("sample")  
@AutoJsonRpcServiceImpl  
public class SampleApi implements NoneBusinessInterface{  
	@JsonRpcMethod("differentMethodName")  
	public Object rawMethodName(Object args) {  
		//some code  
	}  
}  

Due to the Spring bean Enhancement, method.isAnnotationPresent(JsonRpcMethod.class) doesn't work properly:

 com.googlecode.jsonrpc4j.ReflectionUtil{  
	static Set<Method> findCandidateMethods(Class<?>[] classes, String name) {  
             for (Class<?> clazz : classes) {  
                for (Method method : clazz.getMethods()) {  
                    if (method.isAnnotationPresent(JsonRpcMethod.class)) {  
                        ..............  
                    }  
                }  
             }  
        }  
}  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant