Spark visually shows that a message is not sent

Description

Happens to 4% of our 214 Spark deployment, all using Luna skin (happened on Substance too). Usually happens to older computers with low resources.

A user types a message, hits Enter. The message is sent to the recepient, but the user still sees it in the input field and chat window doesn't show it as sent. And the user usually can't see incoming messages either. Often a user can close a chat window, open it again and then see message in the quick history. Usually a user needs to restart Spark to fix this.

Error logged:
Rgp 12, 2013 2:07:11 PM org.jivesoftware.spark.util.log.Log error
SEVERE: Error sending message
java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at javax.swing.text.SimpleAttributeSet.addAttribute(Unknown Source)
at javax.swing.text.StyleConstants.setForeground(Unknown Source)
at org.jivesoftware.spark.ui.TranscriptWindow.insertMessage(TranscriptWindow.java: 191)
at org.jivesoftware.spark.ui.rooms.ChatRoomImpl.sendMessage(ChatRoomImpl.java:363)
at org.jivesoftware.spark.ui.rooms.ChatRoomImpl.sendMessage(ChatRoomImpl.java:346)
at org.jivesoftware.spark.ui.rooms.ChatRoomImpl.sendMessage(ChatRoomImpl.java:319)
at org.jivesoftware.spark.ui.ChatRoom.checkForEnter(ChatRoom.java:698)
at org.jivesoftware.spark.ui.ChatRoom.access$300(ChatRoom.java:90)
at org.jivesoftware.spark.ui.ChatRoom$3.keyPressed(ChatRoom.java:335)
at java.awt.AWTEventMulticaster.keyPressed(Unknown Source)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I can't understand anything, but this looks interesting:
at org.jivesoftware.spark.ui.ChatRoom.checkForEnter(ChatRoom.java:698)
at org.jivesoftware.spark.ui.ChatRoom.access$300(ChatRoom.java:90)

Maybe Spark is checking for Enter press, but can't register it for showing that message was sent, though it is enough to send actual message on the background and add it to the transcript.

Btw, so far Spark restart is enough to mitigate this issue for some time. Log out and login doesn't fix this error.

P.S. Wonder what would happen if Spark had "Send" button. Maybe it would be possible to show that message was sent, when sent with that button and not the Enter key.

Environment

None

Activity

Show:
Mircea Carasel
November 26, 2013, 9:21 AM

Committed r13817

Patch from Aleksey - Thanks!

wroot
October 8, 2013, 3:22 PM

As i said in the description all users use luna skin (default spark skin, which is part of jtattoo). I myself use substance and it has never happened to me. Though one user experienced this on substance too. I believe it is not related to skins.

Walter Ebeling
October 8, 2013, 7:54 AM

Please note that Substance is not a supported Spark skin due to significant side effects in the GUI. Substance is not maintained any more and I would suggest to use a JTattoo based skin since this has not shown any problems (besides being not the visual experience some users want to have).

Jason Sipula
September 11, 2013, 6:41 PM

Posting patch made by Aleksey in the forum. – needs review and commit.

Fixed

Priority

Major

Assignee

Mircea Carasel

Reporter

wroot

Affects versions

Fix versions

Components