简体   繁体   中英

Error in GraniteDS while deserializing RemoteObject

I'm trying to use RemoteObject from ActionScript to execute simple method on Java server side using GraniteDS. However, I'm getting this exception:

15:43:30,630 DEBUG http-bio-8080-exec-27 webapp.AMFEndpoint:64 - >> Deserializing AMF0 request...
15:43:30,630 ERROR http-bio-8080-exec-27 webapp.AMFEndpoint:91 - AMF message error
java.io.EOFException
    at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:323)
    at org.granite.messaging.amf.io.AMF0Deserializer.readHeaders(AMF0Deserializer.java:94)
    at org.granite.messaging.amf.io.AMF0Deserializer.<init>(AMF0Deserializer.java:76)
    at org.granite.messaging.webapp.AMFEndpoint.service(AMFEndpoint.java:66)
    at org.granite.spring.FlexFilter.handle(FlexFilter.java:245)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)

And so on. Here is the ActionScript part:

remoteService = new RemoteObject();
remoteService.destination = "targetService";
remoteService.endpoint = "http://192.168.15.19:8080/test/";
remoteService.addEventListener(FaultEvent.FAULT, onRemoteServiceFault);
remoteService.connect.addEventListener(ResultEvent.RESULT, onConnectResult);
remoteService.connect();

I made some debug and monitoring, and I could see the AMF message the client sent. And it looked normally. However AMF0Deserializer can't deserialize it.

Am I sending it wrong? Or there should be an error on the server side?

Actually, I found the error. There is nothing wrong with the messages, but on the server side there shouldn't be AMFMessageFilter. Instead I use AMFMessageServlet - it serialize/deserialize without any problems, and everything works great.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM