blanchg / dart_amf

Native dart interface to AMF and blazeds
MIT License
4 stars 1 forks source link

A wierd situation on chrome when dart_amf used #1

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi, blanchg I use the latest dart_amf in my webapp, and everything goes perect to call remote function and get remote object in Chromium 45. However, when l deploy the webapp on to server with jboss, and use the chrome 50 to run, dart_amf will return 'unregistered class xxxxxxx occurued' after remote function call. I do not understand what's difference beteewn the two browsers. Could you provide me with some directions?

ghost commented 8 years ago

I fogot to comment that objects in server side were registerd with @remote object in the client side

blanchg commented 8 years ago

Does your deployed version on jboss work with Chromium 45 as well?

ghost commented 8 years ago

Yes, deployed version is workable with chromium45, but are fail on chrome50. I tried to print out what I got after remote call, the instance(object) list was recieved by chromium, and the json objecct list was recieved. So interesting.

blanchg commented 8 years ago

You will likely need to debug the names coming back and the names being registered when you use @RemoteClass

lib/src/amf_io.dart function readScriptObject

This function is where it decodes the incoming objects maybe uncomment the print statements and see what you can discover from that. Hopefully it is just a simple change to get it working for both.

ghost commented 8 years ago

Thanks for your suggestions. Something different were found when webapp executed on two browsers. Chromium would load the native dart script to execute, and chrome load the js code compiled by dart2js. The difference was observed by the dev tool. Furthermore, adopted your suggestios, l found maps for registered objects in amf_io will not keep my @RemoteObject, and only keep flex related class. So, I force to call registerClass to register my class in main, but when l used print to list all map, my clazz become meaningless alphabets, like {“com. mycompany.ws”, rj}, “rj” is the remote object “MyController”.

blanchg commented 8 years ago

What is the name of the class it is looking for compared to the name you registered.

e.g. compare the output of https://github.com/blanchg/dart_amf/blob/master/lib/src/amf_io.dart#L621 with your code Amf.registerClass("server.package.Animal", Animal);