As mentioned here (https://community.igniterealtime.org/message/238894#238894) I get the following exception in 4.0.0-rc2:
org.jivesoftware.smack.XMPPConnection$ListenerNotification run
SEVERE: Exception in packet listener
java.lang.NullPointerException
at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:59)
at org.jivesoftware.smack.util.XmlStringBuilder.length(XmlStringBuilder.java:193)
at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:59)
at org.jivesoftware.smack.util.LazyStringBuilder.toString(LazyStringBuilder.java:8 3)
at org.jivesoftware.smack.util.XmlStringBuilder.toString(XmlStringBuilder.java:208 )
at org.jivesoftware.smack.debugger.LiteDebugger$10.processPacket(LiteDebugger.java :244)
at org.jivesoftware.smack.XMPPConnection$ListenerWrapper.notifyListener(XMPPConnec tion.java:1196)
at org.jivesoftware.smack.XMPPConnection$ListenerNotification.run(XMPPConnection.j ava:1106)
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)
The exception is only thrown, when debug is enabled. After a lot of debugging by myself, I found out that the problem occurs when the debugger calls getChildElementXML() on an object of DiscoverInfo. The message looks as follows:
<query xmlns="[http://jabber.org/protocol/disco#info](http://jabber.org/protocol/disco#info)" node="9869516c-00ed-43ae-883c-3fb0ee311aeb">
…
The problem is located here (DiscoverInfo#Identity, line 330), because “name” is null which causes a NullPointerException.
public XmlStringBuilder toXML() {
XmlStringBuilder xml = new XmlStringBuilder();
xml.halfOpenElement(“identity”);
xml.xmllangAttribute(lang);
xml.attribute(“category”, category);
xml.attribute(“name”, name);
xml.optAttribute(“type”, type);
xml.closeEmptyElement();
return xml;
}
Is there a way to fix this issue?
As far as I understand the example in XEP-0060: Publish-Subscribe, page 15 (http://xmpp.org/extensions/xep-0060.pdf) the attribute “name” must not be present.