Smack 3.4.1

After changing the .jar files to use the 3.4.1, I find that my code is unable to run , ie when using the previous version of the smack api, my messages will be sent with an additional line of “Username : null”. However after using the 3.4.1 version the messages that I send from 1 client to another client arent getting recived I am unsure how to solve.

How do you expect to get help without showing the code, errors from the logs and more information? There are no mind readers here. Also you tag it with google-talk. How is this related?

1 Like

Here is the error below which i copied from the console.

java.lang.NullPointerException

at BuddyListFrame.startChat(BuddyListFrame.java:484)

at BuddyListFrame.access$8(BuddyListFrame.java:483)

at BuddyListFrame$2.chatCreated(BuddyListFrame.java:185)

at org.jivesoftware.smack.ChatManager.createChat(ChatManager.java:227)

at org.jivesoftware.smack.ChatManager.createChat(ChatManager.java:240)

at org.jivesoftware.smack.ChatManager.access$200(ChatManager.java:48)

at org.jivesoftware.smack.ChatManager$2.processPacket(ChatManager.java:143)

at org.jivesoftware.smack.Connection$ListenerWrapper.notifyListener(Connection.jav a:858)

at org.jivesoftware.smack.PacketReader$ListenerNotification.run(PacketReader.java: 456)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Receive from yai123456789@gmail.com: null

The lines 483 and 484 refer to these lines

private void startChat(final RosterEntry entry) {

Chat chat = connection.getChatManager().createChat(entry.getUser(),

null);

I am unsure of how to fix it .

You have a NullPointerException.

It looks like connection is not initialized in

Chat chat = connection.getChatManager().createChat(entry.getUser(),null);

The stack trace show a strange flow to your code. Your listener is being notified that a Chat has been created, and then you attempt to create another Chat.