Re: Problem with List param (dubbo version: 2.7.15)

2022-04-20 Thread Daniel SAWAN
After some google search about this problem i saw a github issue with a
developper having the same problem

https://github.com/apache/dubbo/issues/3779

>From what I understand this issue has been fixed so for which reason do you
guys think i still have the problem ?

Thanks for your help !

Le jeu. 14 avr. 2022 à 16:01, Daniel SAWAN  a écrit :

> I am using fastjson without importing the
> maven dubbo-serialization-fastjson pom. Seems like it is included in Dubbo.
>
> My consumer url is
> : 
> reference.setUrl("dubbo://"+vpsIp+":20880/"+interfaceName+"?token=1234567=fastjson");
>
> So as you can see i put the serialization directly in the URL because i
> didn't find a way to configure it in java. (if you can help on this...)
>
> "I think the the exception happened on the provider side when trying to
> deserialize raw json data to java bean."
> That's exactly what is happening.
>
> "FastjsonObjectInput#readObject(Class cls, Type type)"
>
> This method is never called. The called method is "public  T
> readObject(Class cls)"
>
> here is some screenshots to show you what is happening :
>
> https://i.imgur.com/VAdQKlt.png
> https://i.imgur.com/5su4FsJ.png
>
> and finally when the error happen : https://i.imgur.com/66zfbUi.png
>
> So yes it seems like when using fastjson it got a Map of JSONObject
> instead of a List of OperatingSystemVersion.
> If i remove from the consumer url the param serialization=fastjson
> everything work fine.
>
>
>
>
>
>
> Le jeu. 14 avr. 2022 à 15:11, Jun Liu  a écrit :
>
>> Are you using fastjson as the default serialization protocol there? Say
>> by using ‘dubbo-serialization-fastjson’?
>>
>> I think the the exception happened on the provider side when trying to
>> deserialize raw json data to java bean. Would you please set a breakpoint
>> at the following place to try to debug and see the exact type of the second
>> argument ’type’?
>>
>>   FastjsonObjectInput#readObject(Class cls, Type type)
>>
>> I guess it’s because the autoType feature has been disabled in the latest
>> several fastjson releases for security reasons.
>>
>> Jun
>>
>> > On Apr 8, 2022, at 11:20 PM, Daniel SAWAN 
>> wrote:
>> >
>> > client side error :
>> > Caused by: org.apache.dubbo.remoting.RemotingException:
>> > com.alibaba.fastjson.JSONException: autoType is not support.
>> > java.lang.ClassCastException
>> >
>> > Seems like instead of sending a List dubbo client is sending a
>> > List to Dubbo server.
>>
>>


Re: Problem with List param (dubbo version: 2.7.15)

2022-04-14 Thread Daniel SAWAN
I am using fastjson without importing the
maven dubbo-serialization-fastjson pom. Seems like it is included in Dubbo.

My consumer url is
: 
reference.setUrl("dubbo://"+vpsIp+":20880/"+interfaceName+"?token=1234567=fastjson");

So as you can see i put the serialization directly in the URL because i
didn't find a way to configure it in java. (if you can help on this...)

"I think the the exception happened on the provider side when trying to
deserialize raw json data to java bean."
That's exactly what is happening.

"FastjsonObjectInput#readObject(Class cls, Type type)"

This method is never called. The called method is "public  T
readObject(Class cls)"

here is some screenshots to show you what is happening :

https://i.imgur.com/VAdQKlt.png
https://i.imgur.com/5su4FsJ.png

and finally when the error happen : https://i.imgur.com/66zfbUi.png

So yes it seems like when using fastjson it got a Map of JSONObject instead
of a List of OperatingSystemVersion.
If i remove from the consumer url the param serialization=fastjson
everything work fine.






Le jeu. 14 avr. 2022 à 15:11, Jun Liu  a écrit :

> Are you using fastjson as the default serialization protocol there? Say by
> using ‘dubbo-serialization-fastjson’?
>
> I think the the exception happened on the provider side when trying to
> deserialize raw json data to java bean. Would you please set a breakpoint
> at the following place to try to debug and see the exact type of the second
> argument ’type’?
>
>   FastjsonObjectInput#readObject(Class cls, Type type)
>
> I guess it’s because the autoType feature has been disabled in the latest
> several fastjson releases for security reasons.
>
> Jun
>
> > On Apr 8, 2022, at 11:20 PM, Daniel SAWAN  wrote:
> >
> > client side error :
> > Caused by: org.apache.dubbo.remoting.RemotingException:
> > com.alibaba.fastjson.JSONException: autoType is not support.
> > java.lang.ClassCastException
> >
> > Seems like instead of sending a List dubbo client is sending a
> > List to Dubbo server.
>
>


Re: Problem with List param (dubbo version: 2.7.15)

2022-04-14 Thread Jun Liu
Are you using fastjson as the default serialization protocol there? Say by 
using ‘dubbo-serialization-fastjson’?

I think the the exception happened on the provider side when trying to 
deserialize raw json data to java bean. Would you please set a breakpoint at 
the following place to try to debug and see the exact type of the second 
argument ’type’?

  FastjsonObjectInput#readObject(Class cls, Type type) 

I guess it’s because the autoType feature has been disabled in the latest 
several fastjson releases for security reasons. 

Jun

> On Apr 8, 2022, at 11:20 PM, Daniel SAWAN  wrote:
> 
> client side error :
> Caused by: org.apache.dubbo.remoting.RemotingException:
> com.alibaba.fastjson.JSONException: autoType is not support.
> java.lang.ClassCastException
> 
> Seems like instead of sending a List dubbo client is sending a
> List to Dubbo server.



Re: Problem with List param (dubbo version: 2.7.15)

2022-04-13 Thread Daniel SAWAN
Hi it is me again.
Nobody has a solution ? It is a simple use case to reproduce.

Le ven. 8 avr. 2022 à 17:20, Daniel SAWAN  a écrit :

> Hello,
>
> I have a method on a dubbo server :
>
> public void test(List users);
>
> when i call it from dubbo client i got 2 errors:
>
> server side error :
> java.lang.ClassCastException: class com.alibaba.fastjson.JSONObject cannot
> be cast to class models.User (com.alibaba.fastjson.JSONObject and
> models.User are in unnamed module of loader java.net.URLClassLoader
> @14f3c6fc)
>
> client side error :
> Caused by: org.apache.dubbo.remoting.RemotingException:
> com.alibaba.fastjson.JSONException: autoType is not support.
> java.lang.ClassCastException
>
> Seems like instead of sending a List dubbo client is sending a
> List to Dubbo server.
>
> If someone knows the reason...
>
> Thanks for your help !
>


Problem with List param (dubbo version: 2.7.15)

2022-04-08 Thread Daniel SAWAN
Hello,

I have a method on a dubbo server :

public void test(List users);

when i call it from dubbo client i got 2 errors:

server side error :
java.lang.ClassCastException: class com.alibaba.fastjson.JSONObject cannot
be cast to class models.User (com.alibaba.fastjson.JSONObject and
models.User are in unnamed module of loader java.net.URLClassLoader
@14f3c6fc)

client side error :
Caused by: org.apache.dubbo.remoting.RemotingException:
com.alibaba.fastjson.JSONException: autoType is not support.
java.lang.ClassCastException

Seems like instead of sending a List dubbo client is sending a
List to Dubbo server.

If someone knows the reason...

Thanks for your help !