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 when PojoUtils transfer Null element in Collection #4299

Closed
2 tasks
HzjNeverStop opened this issue Jun 13, 2019 · 1 comment
Closed
2 tasks

NPE when PojoUtils transfer Null element in Collection #4299

HzjNeverStop opened this issue Jun 13, 2019 · 1 comment
Milestone

Comments

@HzjNeverStop
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.3-SNAPSHOT
  • Operating System version:mac os 10.13.6
  • Java version: 1.8.0_171

Steps to reproduce this issue

  1. export an dubbo service which has a method with an collection argument
    @Override
    public String testListName(List<String> list) {
        return list.toString();
    }
  1. start a telnet invoke or generic call to invoke the service
    dubbo>invoke testListName(["a","b",null])

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

result: "[a, b, null]"

Actual Result

What actually happens?

throw an NPE when pojoUtils invoke method #realize0

If there is an exception, please attach the exception trace:

Failed to invoke method testListName, cause: java.lang.NullPointerException
java.lang.NullPointerException
	at org.apache.dubbo.common.utils.PojoUtils.realize0(PojoUtils.java:369)
	at org.apache.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:205)
	at org.apache.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:95)
	at org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokeTelnetHandler.telnet(InvokeTelnetHandler.java:125)
	at org.apache.dubbo.remoting.telnet.support.TelnetHandlerAdapter.telnet(TelnetHandlerAdapter.java:59)
	at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:205)
	at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
	at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
zonghaishang pushed a commit that referenced this issue Jun 24, 2019
…4299) (#4300)

* fix NPE when PojoUtils realize Null element in collection(#4299)

* add unit tests for bugfix of PojoUtils NPE(#4299)

* revert import (#4299)
@beiwei30 beiwei30 added this to the 2.7.5 milestone Aug 6, 2019
@CrazyHZM
Copy link
Member

CrazyHZM commented Sep 6, 2019

Has been fixed.

@CrazyHZM CrazyHZM closed this as completed Sep 6, 2019
rolandhe pushed a commit to rolandhe/dubbo that referenced this issue Sep 9, 2019
…pache#4299) (apache#4300)

* fix NPE when PojoUtils realize Null element in collection(apache#4299)

* add unit tests for bugfix of PojoUtils NPE(apache#4299)

* revert import (apache#4299)
rolandhe pushed a commit to rolandhe/dubbo that referenced this issue Sep 9, 2019
…pache#4299) (apache#4300)

* fix NPE when PojoUtils realize Null element in collection(apache#4299)

* add unit tests for bugfix of PojoUtils NPE(apache#4299)

* revert import (apache#4299)
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

3 participants