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

NPE encountered when using dubbo-mock-admin #122

Open
cdfive opened this issue Jun 16, 2022 · 0 comments
Open

NPE encountered when using dubbo-mock-admin #122

cdfive opened this issue Jun 16, 2022 · 0 comments

Comments

@cdfive
Copy link

cdfive commented Jun 16, 2022

Environment

  • Dubbo version: 3.0.8
  • Dubbo Admin version: 0.4.0
  • dubbo-mock-admin version: 3.0.6-SNAPSHOT

Add depedency dubbo-mock-admin in consumer project, using the AdminMockFilter provided.
I found that after mockResult got by mockService.mock(mockContext),
if the result is not enable, theninvoker.invoke(invocation) will throw NPE.

It seems that the consumerUrl has been changed in RpcServiceContext,
the protocolServiceKey is org.apache.dubbo.mock.api.MockService,
and getServiceInfo(protocolServiceKey) can't get the serviceInfo.

Exception trace:

[nio-9092-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
	at org.apache.dubbo.registry.client.InstanceAddressURL.getServiceMethodParameter(InstanceAddressURL.java:243) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.registry.client.InstanceAddressURL.getMethodParameter(InstanceAddressURL.java:266) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.common.URL.getMethodParameter(URL.java:834) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.initLoadBalance(AbstractClusterInvoker.java:425) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:335) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.cluster.router.RouterSnapshotFilter.invoke(RouterSnapshotFilter.java:46) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:321) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:99) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:321) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:321) ~[dubbo-3.0.8.jar:3.0.8]
	at org.apache.dubbo.mock.filter.AdminMockFilter.invoke(AdminMockFilter.java:148) ~[dubbo-mock-admin-3.0.6-SNAPSHOT.jar:3.0.6-SNAPSHOT]
	...
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