You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/16 08:55:41 UTC
[GitHub] [dubbo-spi-extensions] cdfive opened a new issue, #122: NPE encountered when using dubbo-mock-admin
cdfive opened a new issue, #122:
URL: https://github.com/apache/dubbo-spi-extensions/issues/122
### 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, then`invoker.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]
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org