Home  >  Q&A  >  body text

java - Dubbo interface parameter serialization problem

Problem Description

The current project uses dubbo 2.5.3. There is an interface defined as follows:

String queryBusiness(BusinessDto param);

There is a property in BusinessDto called dealTime, whose type is java.sql.Time

When the consumer calls this interface and passes in parameters, the parameter received by the provider is null. It is the entire entity class that is null, not just this parameter that is null.

Of course, there are other parameters in this BusinessDto class, but in the end it was the problem with this parameter.

Currently available solutions

I asked other people, they will use String or other data types when encountering this type, or convert the entire entity class into JSON and then convert it back from the provider. There is no solution or root cause for this problem. s reason.

Hope for help

If anyone has encountered this problem before or discovered the root cause after studying this problem, please give me some advice. Thank you!

伊谢尔伦伊谢尔伦2702 days ago822

reply all(2)I'll reply

  • 漂亮男人

    漂亮男人2017-05-27 17:43:51

    Our project also uses dubbo 2.5.3. Our external SOA service also uses objects as parameters and time parameters, and we have not encountered this problem.

    private Date createTime;

    Does your BusinessDto implement Serializable? For serialization? But I’m not sure if this is the key to the problem

    reply
    0
  • 怪我咯

    怪我咯2017-05-27 17:43:51

    The source of the problem has been found~

    /a/11...

    Yes, the author is still me...

    reply
    0
  • Cancelreply