Hi Team,
I am new to this zookeeper.
I was trying to understand the SASL concept in zk.
I have tried to run "SaslAuthDesignatedClientTest".
But got the testcase failed. Do I need to modify anything?
Am I learning in the correct way?
Why this AuthFailed happens? How to overcome this?
junit.framework.AssertionFailedError: test failed
:org.apache.zookeeper.KeeperException$AuthFailedException: KeeperErrorCode =
AuthFailed for /zookeeper
at junit.framework.Assert.fail(Assert.java:50)
at
com.indira.zk.test.SaslAuthDesignatedClientTest.testAuth(SaslAuthDesignatedClientTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
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)
And the console logs as follows.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012
17:52 GMT
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:host.name=D-113045348
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.version=1.6.0_37
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.vendor=Sun Microsystems Inc.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.home=C:\Program Files\Java\jre6
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.compiler=<NA>
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:os.name=Windows 7
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:os.arch=x86
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:os.version=6.1
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:user.name=indira
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:user.home=C:\Users\indira
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:user.dir=D:\priya\workspace\zookeeper
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ZooKeeper <init>
INFO: Initiating client connection, connectString=localhost:2181
sessionTimeout=10000 watcher=null
log4j:WARN No appenders could be found for logger (org.apache.zookeeper.Login).
log4j:WARN Please initialize the log4j system properly.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.client.ZooKeeperSaslClient
createSaslClient
INFO: Client will use DIGEST-MD5 as SASL mechanism.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread
logStartConnect
INFO: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will
attempt to SASL-authenticate using Login Context section 'MyZookeeperClient'
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread
primeConnection
INFO: Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating
session
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread onConnected
INFO: Session establishment complete on server 127.0.0.1/127.0.0.1:2181,
sessionid = 0x13bdc564086000c, negotiated timeout = 10000
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$EventThread processEvent
SEVERE: Error while calling watcher
java.lang.NullPointerException
at
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.client.ZooKeeperSaslClient
respondToServer
SEVERE: SASL authentication failed using login context 'MyZookeeperClient'.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$EventThread processEvent
SEVERE: Error while calling watcher
java.lang.NullPointerException
at
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ZooKeeper <init>
INFO: Initiating client connection, connectString=localhost:2181
sessionTimeout=10000 watcher=null
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.client.ZooKeeperSaslClient
createSaslClient
INFO: Client will use DIGEST-MD5 as SASL mechanism.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread
logStartConnect
INFO: Opening socket connection to server 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181.
Will attempt to SASL-authenticate using Login Context section
'MyZookeeperClient'
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxnSocketNIO connect
SEVERE: Unable to open socket to 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2181
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread run
WARNING: Session 0x0 for server null, unexpected error, closing socket
connection and attempting reconnect
java.net.SocketException: Address family not supported by protocol family:
connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at
org.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect(ClientCnxnSocketNIO.java:266)
at
org.apache.zookeeper.ClientCnxnSocketNIO.connect(ClientCnxnSocketNIO.java:276)
at
org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:958)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:993)
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.client.ZooKeeperSaslClient
createSaslClient
INFO: Client will use DIGEST-MD5 as SASL mechanism.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread
logStartConnect
INFO: Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will
attempt to SASL-authenticate using Login Context section 'MyZookeeperClient'
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread
primeConnection
INFO: Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating
session
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$SendThread onConnected
INFO: Session establishment complete on server 127.0.0.1/127.0.0.1:2181,
sessionid = 0x13bdc564086000d, negotiated timeout = 10000
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$EventThread processEvent
SEVERE: Error while calling watcher
java.lang.NullPointerException
at
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.client.ZooKeeperSaslClient
respondToServer
SEVERE: SASL authentication failed using login context 'MyZookeeperClient'.
Dec 27, 2012 7:35:32 PM org.apache.zookeeper.ClientCnxn$EventThread processEvent
SEVERE: Error while calling watcher
java.lang.NullPointerException
at
org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)
Dec 27, 2012 7:35:33 PM org.apache.zookeeper.ClientCnxn$EventThread run
INFO: EventThread shut down
Dec 27, 2012 7:35:33 PM org.apache.zookeeper.ZooKeeper close
INFO: Session: 0x13bdc564086000d closed
Kindly help me out.
Thanks and Regards,
Indira Priyadharshini T
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not the
intended recipient, you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately and destroy all copies of this message and
any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted by this
email.
www.wipro.com