Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6222611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:20:40+00:00 2026-05-24T08:20:40+00:00

I am using Smack API to connect to the Openfire server. I have successfully

  • 0

I am using Smack API to connect to the Openfire server. I have successfully made it work to create user and login user, my problem is I can’t make the logout work, using XMPPConnection.disconnect(), after this, when creating account or logging in another user, the error below is shown. Any one have used Smack API for this kind of scenario?

The app gets this error when tried to login the same or another user:

java.net.SocketException: Socket closed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:146)
    at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
    at sun.security.ssl.InputRecord.read(InputRecord.java:350)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:818)
    at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:775)
    at sun.security.ssl.AppInputStream.read(AppInputStream.java:94)
    at com.jcraft.jzlib.ZInputStream.read(ZInputStream.java:94)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:153)
    at java.io.BufferedReader.read1(BufferedReader.java:204)
    at java.io.BufferedReader.read(BufferedReader.java:278)
    at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2992)
    at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
    at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
    at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:325)
    at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
java.io.IOException: Stream closed
    at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:115)
    at java.io.BufferedWriter.write(BufferedWriter.java:220)
    at java.io.Writer.write(Writer.java:157)
    at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:192)
    at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:40)
    at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:76)
Exception in thread "Smack Packet Reader (0)" java.lang.NullPointerException
    at org.jivesoftware.smack.XMPPConnection.shutdown(XMPPConnection.java:380)
    at org.jivesoftware.smack.PacketReader.notifyConnectionError(PacketReader.java:166)
    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:332)
    at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:20:41+00:00Added an answer on May 24, 2026 at 8:20 am

    Try calling connect once more before you try and login the second time: once you call disconnect to log off the actual socket is closed. connect should re-open it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect to an openfire server using smack API, I am
I have created simple chat application using smack api.i can able to chat well.but
I want to create a Login through Facebook on a website using Graph API
I'm using the Smack API for Java to connect to ejabberd and gtalk servers.
I'm writing an XMPP client in Java using the Smack API. I registered a
I'm making a tabbed view application and using CloudMade's API. I have a working
I am using Xmpp protocol to create chat application with the help of smack
I am developing chat client which can connect to Gtalk and Facebook.I am using
I am building a chat application using JSP, Servlets and Ajax with Smack API.
I have the following code in android - I'm using asmack API. public XMPPManager(String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.