0
public void login() {    

  try {

   connection.login(loginUser, passwordUser);

   Log.i("LOGIN", "Yey! We're connected to the XMPP server!");



  } catch (XMPPException e) {

      e.printStackTrace();

  } catch (SmackException e) {

      e.printStackTrace();

  } catch (IOException e) {

      e.printStackTrace();

  }

  catch (Exception e) {

      Log.i("login fuction","login error");

      e.printStackTrace();

  } 

}

[eclipse error log]

enter image description here

I'm getting an error at this stage after successful connection to the server

Vipul Asri
  • 8,903
  • 3
  • 46
  • 71

3 Answers3

0

i don't have the privilege to comment but from the input that you have given here the error possibly lies in the login function that is throwing the null point exception

Possible cases

1) When you call instance method on a null object. you won't get null pointer exception if you call static method or class method on null object because static method doesn't require an instance to call any method. 2) While accessing or changing any variable or field on null object. 3) Throwing null when an Exception is expected to throw. 4) When calling length of array when array is null. 5) Accessing or changing slots of null just like an array. 6) When you try to synchronize on null object or using null inside synchronized block in Java

give the code for login function for further help Hope this helps you

Shubham Srivastava
  • 1,807
  • 1
  • 10
  • 17
0

Which server are you calling? If you are calling gtalk or fchat, those have stopped using xmpp. You may search in Google to find out. And if you plan to connect to you own ip server, please use xmpptc. It would be nice if you could give some more of your code.

Heisenberg
  • 13
  • 3
0

I've finally found the solution, i had to add smack-java7 in my dependencies