taksan / skype-java-api

Skype API for Java, based on Skype4Java library
128 stars 60 forks source link

NotAttachedException with Skype.addChatMessageListener #51

Closed Shadorc closed 9 years ago

Shadorc commented 9 years ago

Hello, I get this error when I try to add a chat message listener to Skype :

Release : 1.6 Java : 8u11 JDK : 1.8.0_11 OS : Windows 64 bits

com.skype.NotAttachedException at com.skype.Utils.convertToSkypeException(Utils.java:57) at com.skype.Skype.addChatMessageListener(Skype.java:849) at me.shadorc.skyp0matic.Bot.launch(Bot.java:24) at me.shadorc.skyp0matic.frame.Interface.actionPerformed(Interface.java:80) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$400(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: com.skype.connector.NotAttachedException at com.skype.connector.Connector.assureAttached(Connector.java:1023) at com.skype.connector.Connector.addConnectorListener(Connector.java:1087) at com.skype.connector.Connector.addConnectorListener(Connector.java:1059) at com.skype.connector.Connector.addConnectorListener(Connector.java:1041) at com.skype.Skype.addChatMessageListener(Skype.java:847) ... 38 more

sandeeprock12 commented 9 years ago

Try running the Java program multiple times. This is an issue where your Java program is unable to connect to the Skype client. Running it a couple of more times will work.

Shadorc commented 9 years ago

It's good, thanks. I think this is because I launch two instances of Skype with MultiSkypeLauncher and one of them doesn't allow my api to access to it.

anandbansal5 commented 8 years ago

I am still facing the issue with single Skype instance. It keeps giving me the error.

com.skype.NotAttachedException

at com.skype.Utils.convertToSkypeException(Utils.java:57)
at com.skype.Skype.chat(Skype.java:285)
at com.tutorial.skype.SendChatMessage.main(SendChatMessage.java:41)

Caused by: com.skype.connector.NotAttachedException at com.skype.connector.Connector.assureAttached(Connector.java:987) at com.skype.connector.Connector.execute(Connector.java:904) at com.skype.connector.Connector.execute(Connector.java:861) at com.skype.connector.Connector.execute(Connector.java:827) at com.skype.connector.Connector.executeWithId(Connector.java:677) at com.skype.Skype.chat(Skype.java:280) ... 1 more_

Any suggestions on how to get it resolved?