AnsweredAssumed Answered

Connection Failure (Oracle Beehive)

Question asked by Piyush on May 22, 2016
Latest reply on May 22, 2016 by Flow

Hello everyone,

 

I am trying to create xmpp connection using below code:

 

public static void main(String args[]) throws SmackException, IOException, XMPPException, KeyManagementException, NoSuchAlgorithmException {

  // Create the configuration for this new connection
  XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
  //configBuilder.setDebuggerEnabled(true);
  configBuilder.setSendPresence(true);
  configBuilder.setUsernameAndPassword("username", "password");
  configBuilder.setResource("Piyushs-MacBook-Pro");
  configBuilder.setServiceName("abc.com");
  //configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
  configBuilder.setHost("stbeehive.abc.com");
  //TLSUtils.acceptAllCertificates(configBuilder);
  configBuilder.setPort(5223);
  AbstractXMPPConnection connection = new XMPPTCPConnection(configBuilder.build());
  // Connect to the server
  connection.connect();
  // Log into the server
  connection.login();
  connection.disconnect();
  }

 

However, getting below error:

 

Exception in thread "main" 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.SynchronizationPoint.checkForResponse(SynchronizationPoint.java:253)
  at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait(SynchronizationPoint.java:146)
  at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow(SynchronizationPoint.java:125)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:854)
  at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:364)
  at JabberSmackAPI.main(JabberSmackAPI.java:56)

May 22, 2016 12:54:03 PM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection closed with error
org.jivesoftware.smack.SmackException: Parser got END_DOCUMENT event. This could happen e.g. if the server closed the connection without sending a closing stream element
  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1170)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:952)
  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:967)
  at java.lang.Thread.run(Thread.java:745)

 

Can anybody help me to figure out the cause of error. Thanks in advance.

Outcomes