Android 版 Openymsg
我正在为 Android 开发 YM 客户端。我已经包含了 openymsg0.5 api。当我运行该程序时,它显示以下错误。
06-29 11:32:04.097: ERROR/InputThread(11206): org.openymsg.network.LoginRefusedException: Login Failed, unable to retrieve stage 2 url
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.Session.yahooAuth16Stage2(Session.java:2048)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.Session.yahooAuth16Stage1(Session.java:1955)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.Session.receiveAuth(Session.java:1848)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.InputThread.processPayload(InputThread.java:139)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.InputThread.process(InputThread.java:129)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.InputThread.run(InputThread.java:71)
这是主要错误:
LoginRefusedException:登录失败,无法检索第 2 阶段 url
这个问题之前已被问过,但我还没有找到对我有帮助的答案。有谁知道如何处理这个错误?我已经检查了 openymsg 测试代码和代码库,一切似乎都很好。
我刚刚检查过,它作为 java 应用程序工作正常,但如果用作 android 的一部分,则会出现登录错误。我正在创建会话,如下所示
Session session = new Session();
session.addSessionListener(new SessionListenerClass());
try{
session.login("username", "password");
if (session!=null
&& session.getSessionStatus()== SessionState.LOGGED_ON)
{
System.out.println("It logged on!!!!!!!");
}
}
SessionListner :
public class SessionListenerClass extends SessionAdapter
{
@Override
public void messageReceived(SessionEvent event)
{
// TODO Auto-generated method stub
super.messageReceived(event);
}
@Override
public void notifyReceived(SessionNotifyEvent event)
{
// TODO Auto-generated method stub
super.notifyReceived(event);
}
@Override
public void newMailReceived(SessionNewMailEvent event)
{
// TODO Auto-generated method stub
super.newMailReceived(event);
}
@Override
public void errorPacketReceived(SessionErrorEvent event)
{
// TODO Auto-generated method stub
super.errorPacketReceived(event);
}
@Override
public void connectionClosed(SessionEvent event)
{
// TODO Auto-generated method stub
super.connectionClosed(event);
}
}
I am developing YM client for Android. I've included the openymsg0.5 api. When I run the program it shows following error.
06-29 11:32:04.097: ERROR/InputThread(11206): org.openymsg.network.LoginRefusedException: Login Failed, unable to retrieve stage 2 url
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.Session.yahooAuth16Stage2(Session.java:2048)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.Session.yahooAuth16Stage1(Session.java:1955)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.Session.receiveAuth(Session.java:1848)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.InputThread.processPayload(InputThread.java:139)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.InputThread.process(InputThread.java:129)
06-29 11:32:04.097: ERROR/InputThread(11206): at org.openymsg.network.InputThread.run(InputThread.java:71)
This is the main error:
LoginRefusedException: Login Failed, unable to retrieve stage 2 url
This question has been asked before but I haven't found an answer that has helped me. Does anyone have any idea about how to deal with this error? I have gone through the openymsg test code and code base and everything seems to be fine.
I just checked , it works fine as a java application but if used as part of android it gives log in error .I am creating session as follows
Session session = new Session();
session.addSessionListener(new SessionListenerClass());
try{
session.login("username", "password");
if (session!=null
&& session.getSessionStatus()== SessionState.LOGGED_ON)
{
System.out.println("It logged on!!!!!!!");
}
}
SessionListner :
public class SessionListenerClass extends SessionAdapter
{
@Override
public void messageReceived(SessionEvent event)
{
// TODO Auto-generated method stub
super.messageReceived(event);
}
@Override
public void notifyReceived(SessionNotifyEvent event)
{
// TODO Auto-generated method stub
super.notifyReceived(event);
}
@Override
public void newMailReceived(SessionNewMailEvent event)
{
// TODO Auto-generated method stub
super.newMailReceived(event);
}
@Override
public void errorPacketReceived(SessionErrorEvent event)
{
// TODO Auto-generated method stub
super.errorPacketReceived(event);
}
@Override
public void connectionClosed(SessionEvent event)
{
// TODO Auto-generated method stub
super.connectionClosed(event);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用的库基于jYMSG-库,该库具有更好的文档。
抛出异常的文档 LoginRefusedException 内容如下:
因此,您可以检查是否是“其他内容”或只是错误的用户名/密码。
好吧,这似乎是库中的一个错误。我发现这个这表明项目负责人之一知道问题。但我不确定这个问题是否会很快得到解决。
您还应该注意到,该项目被标记为“alpha”。我只能建议您继续关注解决此问题的新版本。
The library you're using is based on the jYMSG-library, which has a way better documentation.
The Documentation for your thrown exception, the LoginRefusedException reads:
So you can check if it's "something else" or just a wrong username/password.
Okay, this seams to be a bug in the library. I found this which shows that one of the project leaders knows about the problem. But I'm not sure if this will be fixed soon.
You should also notice, that the project is marked as "alpha". I can only suggest that you stay tuned for new releases which fix this issue.