Api Fails to login
Status: Alpha
Brought to you by:
javakiddy
We have been seeing intermittent problems logging in to
messenger through this API even though the regular
yahoo IM application works just fine. Anyone else
experienced this problem lately ?
Interestingly enough, we get logged off from the regular
IM app (if we are using the same account for both) even
when such failures are reported.
Here is the message dump we get when the failures
happen.
-------------------------
java.io.InterruptedIOException: Login timed out
at ymsg.network.Session.login(Unknown Source)
at getBuddies.connect(getBuddies.java:51)
at getBuddies.main(getBuddies.java:22)
Logged In: YES
user_id=1321795
I have the same error. But i login with my Yahoo Messenger
client, then run the login code (of course w/ another
account). I see my test account login in my Friend list, but
the code stop at login method, then Login timed out. Anyone
solved it? Please help me.
Logged In: NO
Even I too face the same problem. The program does not
transfer the control back after the login method, although
the user is logged in.
The following the program I am using:
--------------------
package messenger;
import java.io.IOException;
import ymsg.network.AccountLockedException;
import ymsg.network.DirectConnectionHandler;
import ymsg.network.LoginRefusedException;
import ymsg.network.Session;
import ymsg.network.StatusConstants;
import ymsg.network.event.SessionAdapter;
import ymsg.network.event.SessionEvent;
import ymsg.network.event.SessionListener;
public class Messenger {
protected static Session mySession;
public static void main(String[] args) throws
java.io.InterruptedIOException, AccountLockedException,
IllegalStateException, LoginRefusedException, IOException
{
try { attemptLogin(); }catch
(Exception e) { e.printStackTrace(); }
System.out.print("here I am1");
mySession.sendMessage
("someoneelse", "testmessage");
System.out.print("here I am2");
}
private static void attemptLogin() throws Exception
{
mySession = new Session();
String username = "someone";
String password = "somepassword";
//System.out.println
(">>"+username+" "+password);
// -----Login to Yahoo
try
{ mySession.login(username,password);
}
catch(AccountLockedException e)
{ System.out.println("Your account
is locked");
if(e.getWebPage()!=null)
System.out.println("Please visit: "+e.getWebPage().toString
());
throw e;
}
catch(LoginRefusedException e)
{ System.out.println("Yahoo refused
our connection. Username/password incorrect?");
throw e;
}
// -----Are we cooking with gas?
if(mySession.getSessionStatus()
==StatusConstants.MESSAGING)
{ System.out.println
(mySession.getConnectionHandler().toString());
}
else
{ System.out.println("Sorry, there
was a problem connecting");
}
}
}
-------------------
I have wantedly not used any sessionlisteners.