title: Why am I getting "Connection Closed on Error" with XMPP
body: <p>XMPP Library being used:</p>
  
  <pre><code> "org.igniterealtime.smack" % "smack-java7" % "4.1.8",
   "org.igniterealtime.smack" % "smack-tcp" % "4.1.8",
   "org.igniterealtime.smack" % "smack-core" % "4.1.8",
   "org.igniterealtime.smack" % "smack-extensions" % "4.1.8",
  </code></pre>
  
  <p>Hi,</p>
  
  <p>We have a XMPP server which connects to FCM XMPP server, sometime we see following errors from our XMPP Connection sometimes:</p>
  
  <pre><code>2018-11-30T19:08:38.306+05:30 STDIO [ERROR] Nov 30, 2018 7:08:38 PM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
  WARNING: Connection closed with error
  java.io.EOFException: input contained no data
          at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003)
          at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
          at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410)
          at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
          at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
          at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1177)
          at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:956)
          at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:971)
          at java.lang.Thread.run(Thread.java:745)
  2018-11-30T19:08:38.306+05:30 PROCESSORS [ERROR] XMPPConnectionListener -&gt; connectionClosedOnError: null input contained no data
  java.io.EOFException: input contained no data
          at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003) ~[stormjar.jar:?]
          at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046) ~[stormjar.jar:?]
          at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410) ~[stormjar.jar:?]
          at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395) ~[stormjar.jar:?]
          at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) ~[stormjar.jar:?]
          at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1177) [stormjar.jar:?]
          at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:956) [stormjar.jar:?]
          at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:971) [stormjar.jar:?]
          at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
  2018-11-30T19:08:38.306+05:30 STDIO [INFO] 07:08:38 PM XMPPConnection closed due to an exception (1)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] java.io.EOFException: input contained no data
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1177)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:956)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:971)
  2018-11-30T19:08:38.306+05:30 STDIO [ERROR] at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I am not able to not able to find what is the reason for these, why these are coming because same code works most of the time, but some times suddenly I start to get this error. I also see same reported <a href="https://igniterealtime.jiveon.com/thread/16941" rel="nofollow noreferrer">here</a> long back but no resolution.</p>