Kate, previously server code library wasn’t up to date, so I downloaded latest server code and iOS SDK.
Other problems are gone except for getting below message when retrieving message.
FYI, I do not run any server code for messaging.
Error receiving messages [Server.Processing] java.lang.RuntimeException: java.lang.ClassCastException: com.backendless.services.messaging.BackendlessSubscriber cannot be cast to java.util.HashMap
API used for retrieving message is the following.
-(void)subscribe:(NSString *)channelName subscriptionResponse:(void(^)(NSArray *))subscriptionResponseBlock subscriptionError:(void(^)(Fault *))subscriptionErrorBlock subscriptionOptions:(SubscriptionOptions *)subscriptionOptions response:(void(^)(BESubscription *))responseBlock error:(void(^)(Fault *))errorBlock;
It looks like all the custom codes are failing.On my client app error message I get is belowDomain=NSURLErrorDomain Code=-1001 “The request timed out.”
on the server, developer’s log, I see some casting exception like below.
I meant that I am not using GenericChannelEventHandler.
The messaging that is printed is from custom server code, I use custom server code to push message using below api, which I had it for long time, didn’t have problem.
Backendless.Messaging.publish(…)
When I created this issue, I wasn’t calling this custom code(messaging), but kept getting “cannot be cast to java.util.HashMap” when after subscribing with below API.
Hi Scott!
As the result we have 2 issues:
1st: after subscribing with ios sdk you receive “cannot be cast to java.util.HashMap”.
Do you receive this error always or in some special cases?
2nd: you have custom event handler with Backendless.Messaging.publish(…) code. It worked previously and stopped working yesterday?
I understood you correctly?
Please provide handler code and way how you invoke it.
Regards,
Kate.
Subscribe issue
Do you receive this error always or in some special cases?
I receive the error all the time, there’s nothing special with my code. It is easy to reproduce, from code gen sample chat, just change the subscribe part to below api, and you will receive error message “cannot be cast to …” in “subscriptionError:(void(^)(Fault *))subscriptionErrorBlock” every polling period (1 second).
server code timeout
What happened is that I was debugging server code(didn’t set break point though), and console started to show errors, and calling custom server code responded with time out until today. The below is log from console from application.log file.
2015-07-27 16:03:09,074 [INFO] Runner successfully registered
2015-07-27 16:03:09,075 [INFO] Parsing event model…
2015-07-27 16:03:09,188 [INFO] Build successfully: EventModel{timers=0, eventHandlers=10}
2015-07-27 16:03:09,188 [INFO] Deploying model to server, and starting debug…
2015-07-27 16:03:10,828 [INFO] Model successfully deployed…
2015-07-27 16:03:10,828 [INFO] Waiting for events…
2015-07-27 16:17:15,438 [ERROR] Connection issue
redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:207) ~[CodeRunner.jar:na]
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:47) ~[CodeRunner.jar:na]
at redis.clients.jedis.Protocol.process(Protocol.java:131) ~[CodeRunner.jar:na]
at redis.clients.jedis.Protocol.read(Protocol.java:196) ~[CodeRunner.jar:na]
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:283) ~[CodeRunner.jar:na]
at redis.clients.jedis.Connection.getIntegerReply(Connection.java:208) ~[CodeRunner.jar:na]
at redis.clients.jedis.BinaryJedis.rpush(BinaryJedis.java:1015) ~[CodeRunner.jar:na]
at com.backendless.coderunner.processor.ResponderProcessor.run(ResponderProcessor.java:49) ~[CodeRunner.jar:na]
message publishing error log
I use message publish in server code “SendTextAsyncEvent”.
Calling this server code, I see some error logs from server code developer log file. It looks like your code has some casting problem which looks similar to “subscribe issue”.
Although it threw below error from my server code, push is sent/received and message is seen from console messaging. Sometimes push is sent twice though.