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

PojoUtil realize type convert not support subclasses of 'java.util.date' #2499

Closed
2 tasks done
ningyu1 opened this issue Sep 13, 2018 · 0 comments
Closed
2 tasks done
Labels
type/bug Bugs to being fixed
Milestone

Comments

@ningyu1
Copy link
Contributor

ningyu1 commented Sep 13, 2018

  • 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.5.x, 2.6.x
  • Operating System version: windows 7
  • Java version: jdk1.7,jdk1.8

Steps to reproduce this issue

  1. String convert to java.sql.Time
  2. String convert to java.sql.Date
  3. String convert to java.sql.Timestamp

Expected Result

The Convert is successful and you can get the object of the converted type.

Actual Result

Conversion failed.

When the interface is called by 'jmeter-plugin-dubbo', it is passed into the hashmap through a generalization call. The value in the hashmap is a Date string, and an error occurred when the server accepts a type of java.sql.timestamp |Date

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

java.lang.RuntimeException: Failed to set pojo TestVo property timestamp value 2018-09-13 10:00:00(class java.lang.String), cause: argument type mismatch
	at com.alibaba.dubbo.common.utils.PojoUtils.realize0(PojoUtils.java:456)
	at com.alibaba.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:196)
	at com.alibaba.dubbo.common.utils.PojoUtils.realize(PojoUtils.java:86)
	at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:68)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:103)
	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96)
	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:172)
	at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
	at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:80)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.alibaba.dubbo.common.utils.PojoUtils.realize0(PojoUtils.java:453)
	... 16 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

2 participants