Returning null - (IQ) collector.nextResult (SmackConfiguration. getPacketReplyTimeout())

Trying to establish Server to Server ( S2S ) communication with SMack, but getting error in api file at line

IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout())

in org.jivesoftware.smack.NonSASLAuthentication.java

Please help me out. Thanks in Advance…