taksan/skype-java-api — Issue #9: NotAttachedException throws if call ChatMessage.getStatus() inside ChatMessageListener.chatMessageReceived
Author: evluhin
Created: 2011-12-26 21:03:57+00:00
State: open

if call ChatMessage.getStatus() inside ChatMessageListener.chatMessageReceived(ChatMessage m) execution will stop for some time and then status will change to NOT_RUNNING and will try to reconnect (and it's actually connected) and get refused status.
All listeners are notified but NotAttachedException is thrown.

Example of two messages received (only one copy of stacktrace)
Console log:

Skype: CHATMESSAGE 1675305 STATUS RECEIVED
Skype: CHAT #sergey/$publisher;1d2681243dabfe7f ACTIVITY_TIMESTAMP 1324933032
Skype: CHATMESSAGE 1675337 STATUS RECEIVED
Skype: #0 MESSAGE 1675305 STATUS RECEIVED
Skype: #1 MESSAGE 1675337 STATUS RECEIVED
Skype: CHAT #sergey/$publisher;1d2681243dabfe7f ACTIVITY_TIMESTAMP 1324933056
Skype: #0 MESSAGE 1675305 STATUS RECEIVED
Skype: #1 MESSAGE 1675337 STATUS RECEIVED
com.skype.NotAttachedException
at com.skype.Utils.convertToSkypeException(Utils.java:57)
at com.skype.Utils.getPropertyWithCommandId(Utils.java:97)
at com.skype.ChatMessage.getStatus(ChatMessage.java:211)
at mysite.skype.message.push.service.SkypeServer$1.chatMessageReceived(SkypeServer.java:43)
at com.skype.Skype$3.messageReceived(Skype.java:782)
at com.skype.connector.Connector.fireMessageEvent(Connector.java:1119)
at com.skype.connector.Connector.access$5(Connector.java:1114)
at com.skype.connector.Connector$13.run(Connector.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: com.skype.connector.NotAttachedException
at com.skype.connector.Connector.execute(Connector.java:871)
at com.skype.connector.Connector.execute(Connector.java:827)
at com.skype.connector.Connector.executeWithId(Connector.java:677)
at com.skype.Utils.getPropertyWithCommandId(Utils.java:93)
... 9 more
Caused by: com.skype.connector.NotAttachedException
at com.skype.connector.Connector$11.call(Connector.java:935)
at com.skype.connector.Connector$11.call(Connector.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
... 3 more