求助:SASLErrorsql usingg PLAIN:not-authorized

smack登录服务器时报错,SASL Authentication failed. No known authentication mechanisims
来源:互联网
编辑:刘梓楠
有网友碰到过这样的问题:smack登录服务器时报错,SASL Authentication failed. No known authentication mechanisims,问题详细内容为:smackSASLAuthentication用smack登录openfire服务器时,报SASL鉴权失败,哪位大腿知道怎么解决这问题,帮忙看看~smack版本是4.1.1TestIQ&reg&=&new&TestIQ&(from,serviceName,"",orgId);Builder&builder&=&XMPPTCPConnectionConfiguration.builder();builder.setServiceName(SERVICE_NAME);builder.setUsernameAndPassword(USER_NAME,&PASSWD);builder.setCompressionEnabled(false);builder.setSecurityMode(SecurityMode.disabled);builder.setSendPresence(false);XMPPTCPConnection&connection&=&new&XMPPTCPConnection(builder.build());StanzaFilter&filter&=&new&AndFilter(new&StanzaIdFilter(reg.getStanzaId()),&new&PacketTypeFilter(TestIQ.class));PacketCollector&collector&=&connection.createPacketCollector(filter);try&{connection.connect();connection.login();//----------在这报错connection.sendStanza(reg);}&....错误信息:org.jivesoftware.smack.SmackException:&SASL&Authentication&failed.&No&known&authentication&mechanisims.at&org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:254)at&org.jivesoftware.smack.tcp.XMPPTCPConnection.loginNonAnonymously(XMPPTCPConnection.java:365)at&org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:452)at&org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:410)at&com.star.extInterface.impl.XMPPServerInterfaceImpl.getOrgInfoById(XMPPServerInterfaceImpl.java:77)at&sun.reflect.NativeMethodAccessorImpl.invoke0(Native&Method)at&sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at&sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at&java.lang.reflect.Method.invoke(Method.java:606)at&org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)at&org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at&org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)at&org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)at&org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)at&org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)at&org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)at&org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)at&org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)at&org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)at&org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)at&org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)at&org.junit.runners.ParentRunner.run(ParentRunner.java:309)at&org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)at&org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)at&org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)at&org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)at&org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)at&org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197),我搜你通过互联网收集了相关的一些解决方案,希望对有过相同或者相似问题的网友提供帮助,具体如下:解决方案1:已解决,注册一个鉴权对象。解决方案2:求代码。。。。。我也出现这个问题解决方案3:引用&2&楼&u&的回复:求代码。。。。。我也出现这个问题SASLAuthentication.registerSASLMechanism(new&SASLPlainMechanism());connection.login();我加了这一句,但又有新的问题……解决方案4:我发现是我&jar包没加全,我现在实现了&登录与消息的发送接收你遇到什么问题了解决方案5:引用&4&楼&u&的回复:我发现是我&jar包没加全,我现在实现了&登录与消息的发送接收你遇到什么问题了连接服务器报&noClassDefFound&&&XMPPTCPConfiguation解决方案6:引用&4&楼&u&的回复:我发现是我&jar包没加全,我现在实现了&登录与消息的发送接收你遇到什么问题了我现在报这个错,搞了一天了,蛋疼……org.jivesoftware.smack.SmackException$NoResponseException:&No&response&received&within&reply&timeout.&Timeout&was&5000ms&(~5s).&Used&filter:&No&filter&used&or&filter&was&'null'.&&&&at&org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:106)&&&&at&org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:85)&&&&at&org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:250)&&&&at&org.jivesoftware.smack.tcp.XMPPTCPConnection.loginNonAnonymously(XMPPTCPConnection.java:365)&&&&at&org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:452)&&&&at&org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:410)我在这里又发了一帖http://bbs.csdn.net/topics/解决方案7:问题搞定了,少包!!!!!解决方案8:4.11&文档有点乱,包也很乱都不知道要哪些。解决方案9:4.1.1文档好少啊……我也在搞,官方又推荐用AS,我用Eclipse蛋疼……解决方案10:引用&4&楼&u&的回复:我发现是我&jar包没加全,我现在实现了&登录与消息的发送接收你遇到什么问题了我是初学smack,在android上用smack实在不知道怎么入门,能发个例子学学吗?先谢谢了。解决方案11:缺少的是sasl-provided这个包,加上就没有这个问题了解决方案12:楼上正解。我对于SASLAuthentication.blacklistSASLMechanism("SCRAM-SHA-1")或者SASLAuthentication.unBlacklistSASLMechanism(SCRAM-SHA-1)&都试过了还是报错,加入smack-sasl-provided-4.1.4.jar包后,再报SASLError&using&SCRAM-SHA-1:&not-authorized之类的错误,利用这句SASLAuthentication.blacklistSASLMechanism("SCRAM-SHA-1"),将相应机制隐掉就可以了请注意,本站信息均收集自互联网,相关信息仅供参考,医疗等重要信息请以正规途径为最终意见,本站不承担任何责任!
您可能还关注Re: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found
hive-user mailing list archives
Message view
Edward Capriolo &edlinuxg...@&
Re: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found
Sorry to create list trash but when I saw "mech" I got really excited...
http://en.wikipedia.org/wiki/MechWarrior_2:_31st_Century_Combat#MechWarrior_2:_Ghost_Bear.27s_Legacy
my favourite game series of all time.
On Sat, Apr 26, 2014 at 4:22 AM, Manish Maheshwari &&wrote:
& Thanks Brad. It worked great. I am not sure what auth i am using on Horton
& Image. I have just set it up and started executing python programs via ssh
& from the host.
& On Sat, Apr 26, 2014 at 11:39 AM, Brad Ruderman &&wrote:
&& I am guessing you are missing the plain kerb plugin. Try doing a:
&& yum install cyrus-sasl-plain
&& What auth are you using on HS2?
&& Thanks,
&& On Fri, Apr 25, 2014 at 9:11 PM, Manish Maheshwari &&wrote:
&&& I am using pyhs2 with HortonWorks Hadoop Image and am stuck at -
&&& &&& import pyhs2
&&& &&& with
&&& pyhs2.connect(host='localhost',port=10000,authMechanism="PLAIN",user='root',password='hadoop',database='default')
&&& as conn:
with conn.cursor() as cur:
print cur.getDatabases()
&&& Traceback (most recent call last):
File "&stdin&", line 1, in &module&
File "/usr/lib/python2.6/site-packages/pyhs2/__init__.py", line 7, in
&&& connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/pyhs2/connections.py", line 36,
&&& in __init__
transport.open()
File "/usr/lib/python2.6/site-packages/pyhs2/cloudera/thrift_sasl.py",
&&& line 66, in open
message=("Could not start SASL: %s" % self.sasl.getError()))
&&& thrift.transport.TTransport.TTransportException: Could not start SASL:
&&& Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy
&&& mechs found
&&& I have check and recheck that sasl is installed.
&&& Any ideas why this happens?
&&& Thanks,
&&& Manish
Unnamed multipart/alternative (inline, None, 0 bytes)
(inline, None, 1984 bytes)
(inline, Quoted Printable, 5059 bytes)smack - asmack-android-8-4.0.6: SASLError using DIGEST-MD5: not-authorized - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
J it only takes a minute:
I get following error while login after successfully connecting:
01-15 20:44:07.448
/com.stm.myjob E/XMPPService﹕ Failed to log in as
8b6c219ce6d1d7b5af8a
01-15 20:44:07.448
/com.stm.myjob E/XMPPService﹕
org.jivesoftware.smack.sasl.SASLErrorException: SASLError using DIGEST-MD5: not-authorized
01-15 20:47:07.891
/com.stm.myjob W/PacketWriter﹕ Exception writing closing stream
java.net.SocketException: sendto failed: EPIPE (Broken pipe)
at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:546)
at libcore.io.IoBridge.sendto(IoBridge.java:515)
at java.net.PlainSocketImpl.write(PlainSocketImpl.java:504)
at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:37)
at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:266 )
at java.io.OutputStreamWriter.flushBytes(OutputStreamWriter.java:167)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:158)
at java.io.BufferedWriter.flush(BufferedWriter.java:124)
at org.jivesoftware.smack.tcp.PacketWriter.writePackets(PacketWriter.java:190)
at org.jivesoftware.smack.tcp.PacketWriter.access$000(PacketWriter.java:40)
at org.jivesoftware.smack.tcp.PacketWriter$1.run(PacketWriter.java:77)
Caused by: android.system.ErrnoException: sendto failed: EPIPE (Broken pipe)
at libcore.io.Posix.sendtoBytes(Native Method)
at libcore.io.Posix.sendto(Posix.java:176)
at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:278)
at libcore.io.IoBridge.sendto(IoBridge.java:513)
at java.net.PlainSocketImpl.write(PlainSocketImpl.java:504)
at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:37)
at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:266 )
at java.io.OutputStreamWriter.flushBytes(OutputStreamWriter.java:167)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:158)
at java.io.BufferedWriter.flush(BufferedWriter.java:124)
at org.jivesoftware.smack.tcp.PacketWriter.writePackets(PacketWriter.java:190)
at org.jivesoftware.smack.tcp.PacketWriter.access$000(PacketWriter.java:40)
at org.jivesoftware.smack.tcp.PacketWriter$1.run(PacketWriter.java:77)
I open user on OpenFire server, user name 8b6c219ce6d1d7b5af8a@myjob.uz. If I use asmack- all works fine, but when using asmack-android-8-4.0.6 I get following error.\
Anybody know how to fix it?
Here Connect method:
private void connect(final String login, final String password) {
Thread t = new Thread(new Runnable() {
public void run() {
// Create a connection
ConnectionConfiguration connConfig = new ConnectionConfiguration(
AppConfig.XMPP_HOST, AppConfig.XMPP_PORT, AppConfig.XMPP_SERVICE);
connConfig.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
XMPPConnection connection = new XMPPTCPConnection(connConfig);
HLog.i(TAG, "XMPP connecting ...");
connection.connect();
HLog.i(TAG,
"Connected to " + connection.getHost());
} catch (XMPPException ex) {
HLog.e(TAG, "Failed to connect to "
+ connection.getHost());
HLog.e(TAG, ex.toString());
setConnection(null);
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
// SASLAuthentication.supportSASLMechanism("PLAIN", 0);
connection.login(AppConfig.TEST_USERNAME, AppConfig.TEST_PASSWORD);
HLog.i(TAG,
"HLogged in as " + connection.getUser());
// Set the status to available
Presence presence = new Presence(Presence.Type.available);
connection.sendPacket(presence);
setConnection(connection);
} catch (XMPPException ex) {
HLog.e(TAG, "Failed to log in as "
HLog.e(TAG, ex.toString());
setConnection(null);
} catch (SmackException sexp) {
sexp.printStackTrace();
} catch (IOException ioexp) {
ioexp.printStackTrace();
t.start();
15.6k869109
6,91643349
Maybe you should add this code before adding XMPPTCPConnection configuration:
SASLAuthentication.registerSASLMechanism("PLAIN", SASLPlainMechanism.class);
SASLAuthentication.supportSASLMechanism("PLAIN",0);
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .24807
Stack Overflow works best with JavaScript enabled}

我要回帖

更多关于 oracle using 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信