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 8081053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:36:21+00:00 2026-06-05T16:36:21+00:00

I am trying to make aSmack work in my project. Created a standard project

  • 0

I am trying to make aSmack work in my project. Created a standard project in eclipse, added the jars (smack.jar, smackx-debug.jar, smackx-jingle.jar, smackx.jar) to libs folder . Started using the XMPP classes, but I am not sure if there’s something else I should do to properly set up the project (later on that), since it’s not working. when i run the app i am getting this error Could not find class 'java.beans.PropertyDescriptor', referenced from method org.jivesoftware.smack.util.PacketParserUtils.parseWithIntrospection, when i try to send message i am getting this error java.lang.IllegalStateException: Not connected to server.and at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:445)

this is the code i am using

public  class ClientJabberActivity extends Activity {

   private  final  static String server_host =  "aaaaa.com" ;
   private  final  static  int SERVER_PORT =  5222 ;
   private  final  static String SERVICE_NAME =  "gmail.com" ;  
   private  final  static String LOGIN =  "xxxx@name.com" ;
   private  final  static String PASSWORD =  "yyyy";

   ArrayList<String> m_discussionThread;
   ArrayAdapter<String> m_discussionThreadAdapter;
   XMPPConnection m_connection;
   private Handler m_handler;   

   @ Override 
   public  void  onCreate (Bundle savedInstanceState) { 
   super . onCreate (savedInstanceState);
   setContentView (R.layout.main);
   m_handler =  new  Handler ();
     try  { 
        initConnection ();
     }  catch (XMPPException e) { 
        e. printStackTrace ();
     }

    final EditText recipient = (EditText) this . findViewById (R.id.recipient);
    final EditText message = (EditText) this . findViewById (R.id.message);     
    ListView list = (ListView) this . findViewById (R.id.thread);

    m_discussionThread =  new ArrayList<String>();
    m_discussionThreadAdapter =  new ArrayAdapter<String>  ( this ,
            R.layout.multi_line_list_item,  m_discussionThread);
    list.setAdapter(m_discussionThreadAdapter);

    Button send = (Button) this . findViewById (R.id.send);
    send. setOnClickListener ( new View. OnClickListener () { 
        public  void  onClick (View view) {                 

            String to = recipient.getText().toString ();
            String text = message.getText().toString ();

            Message msg =  new  Message(to, Message.Type.chat);
            msg.setBody(text);
            m_connection.sendPacket (msg);
            m_discussionThread. add ( " Me  : " );
            m_discussionThread. add (text);
            m_discussionThreadAdapter. notifyDataSetChanged ();
         } 
    } );
 }

private  void  initConnection () throws XMPPException { 

    ConnectionConfiguration config = new  ConnectionConfiguration (server_host, SERVER_PORT, SERVICE_NAME);
    m_connection =  new  XMPPConnection (config);
    m_connection.connect ();
    m_connection.login(LOGIN, PASSWORD);
    Presence presence =  new  Presence(Presence.Type.available);
    Log.i("ID", ""+presence);
    m_connection.sendPacket (presence);       

    PacketFilter filter =  new  MessageTypeFilter(Message.Type.chat);

    m_connection.addPacketListener(new PacketListener() {
        public void processPacket(Packet packet) {
            Message message = (Message) packet;
                if (message.getBody() != null) {
                String fromName = StringUtils.parseBareAddress(message.getFrom());
                m_discussionThread.add(fromName + ":");
                m_discussionThread.add(message.getBody());

                m_handler.post(new Runnable() {
                public void run() {
                m_discussionThreadAdapter.notifyDataSetChanged();
                }
                });
            }
        }
    }, filter);

ChatManager chatmanager = m_connection.getChatManager();
  chatmanager.addChatListener(new ChatManagerListener()
  {
    public void chatCreated(final Chat chat, final boolean createdLocally)
    {
      chat.addMessageListener(new MessageListener()
      {
        public void processMessage(Chat chat, Message message)
        {
          System.out.println("Received message: " 
            + (message != null ? message.getBody() : "NULL"));
          Log.i("CHAT USER", "Received message is: "+message.getBody());
        }
      });
    }
  });
}
}

Anybody have experienced this problem in your XMPP client. is it problem in jar files or anything i have to change any thing in my code…

  • 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-06-05T16:36:24+00:00Added an answer on June 5, 2026 at 4:36 pm

    Are you sure that you are using the asmack jars and not the smack jars? because this error looks something that you will get if you are using normal smack.

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

Sidebar

Related Questions

I am trying to make aSmack work in my project. Created a standard project
Trying to make my project using storyboard. I changed my info.plist and added entry
Trying to make the infamous checkall checkbox for dynamically created rows from a MySQL
im trying make one replace in string from a array but this dont work
I'm trying to make a Facebook Chat on Android with the Smack library. I've
I've been banging my head against a wall trying make this work for a
Trying to make a canvas effect work in IE8. With excanvas.js there is no
Trying to make this Reddit-style Voting With PHP, MySQL And jQuery work . Problem:
I'm trying make a login window where a user is prompted to enter their
I'm trying make an entity with doctrine that has three associations with other entities

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.