Error pointer java.lang.NullPointerException when i want to get discoverItems


i’ve an error pointer java.lang.NullPointerException when i want to get discoverItems :

that is my Log :

toto connected

toto not Authenticated

toto Authentication …

toto authenticated

error pointer java.lang.NullPointerException

and that is my code :

XMPPConnection.addConnectionCreationListener(new ConnectionCreationListener() {

public void connectionCreated(XMPPConnection connection) {

Log.i(“msn”, “toto connected”);

if (!connection.isAuthenticated()) {

Log.i(“msn”, “toto not Authenticated”);

Log.i(“msn”, “toto Authentication …”);

try {

connection.login(“micka”, “micka”);

} catch (XMPPException e1) {

// TODO Auto-generated catch block

Log.e(“msn”, “toto error of Authentication”);



if (connection.isAuthenticated()) {

Log.i(“msn”, “toto authenticated”);

ServiceDiscoveryManager discoManager = ServiceDiscoveryManager


try {



} catch (XMPPException e) {


"Can’t get discovery items for entityId: "

  • " : " + e);

} catch (NullPointerException e) {

Log.e(“msn”, "error pointer " + e);


} else

Log.i(“msn”, “toto not authenticated”);



XMPPConnection connexion;

ConnectionConfiguration connConfig = new ConnectionConfiguration(

            "[|]", 5222);

connexion = new XMPPConnection(connConfig);

try {


} catch (XMPPException e) {



where is the error ? 0_0


ERROR/AndroidRuntime(710): at org.jivesoftware.smack.XMPPConnection.initConnection(

ERROR/AndroidRuntime(710): at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection. java:834)

ERROR/AndroidRuntime(710): at org.jivesoftware.smack.XMPPConnection.connect(

i discovered that the error is here :

smack 3.0.4 :


if (isFirstInitialization) {

// Notify listeners that a new connection has been established

for (ConnectionCreationListener listener : connectionEstablishedListeners) {

listener.connectionCreated(this); <== in this line



can you explain me, what i can do ?

by information i use android.

I have that after the error

Sending signal. PID: 619 SIG: 3

threadid=7: reacting to signal 3


“Main” prio=5 tid=3 NATIVE

| group=“main” sCount=1 dsCount=0 s=0 obj=0x40010450

| sysTid=496 nice=0 sched=0/0 handle=-1097270020

at android.os.BinderProxy.transact(Native Method)

at ava:1441)

at android.os.RuntimeInit.crash(

at android.os.RuntimeInit$UncaughtHandler.uncaughtException(

at java.lang.ThreadGroup.uncaughtException(

at java.lang.ThreadGroup.uncaughtException(

(break frame)

at android.dalvik.NativeStart.main(Native Method)

(break frame)

“Smack Listener Processor (0)” daemon prio=5 tid=21 WAIT

| group=“main” sCount=1 dsCount=0 s=0 obj=0x4009bac8

| sysTid=643 nice=0 sched=0/0 handle=1056016

at java.lang.Object.wait(Native Method)

  • waiting on <0x1025e0> (a android.dalvik.Threads$ActiveThread)

at android.dalvik.Threads$ActiveThread.parkFor(

at android.dalvik.Threads.parkFor(

at sun.misc.Unsafe.park(

at java.util.concurrent.locks.LockSupport.park(

at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Abs

at java.util.concurrent.LinkedBlockingQueue.take(

at java.util.concurrent.ThreadPoolExecutor.getTask(

at java.util.concurrent.ThreadPoolExecutor$


(break frame)

“Smack Keep Alive (0)” daemon prio=5 tid=19 WAIT

| group=“main” sCount=1 dsCount=0 s=0 obj=0x401a2da0

| sysTid=642 nice=0 sched=0/0 handle=1042504

at java.lang.VMThread.sleep(Native Method)

at java.lang.Thread.sleep(

at java.lang.Thread.sleep(

at org.jivesoftware.smack.PacketWriter$


(break frame)

“Smack Packet Reader (0)” daemon prio=5 tid=17 RUNNABLE

| group=“main” sCount=1 dsCount=0 s=1 obj=0x400f7970

| sysTid=637 nice=0 sched=0/0 handle=980360

at java.lang.String.regionMatches(

at java.lang.String.equals(

at org.xmlpull.mxp1.MXParser.getAttributeValue(

at org.jivesoftware.smack.PacketReader.parseIQ(

at org.jivesoftware.smack.PacketReader.parsePackets(

at org.jivesoftware.smack.PacketReader.access$000(

at org.jivesoftware.smack.PacketReader$

(break frame)

“Smack Packet Writer (0)” daemon prio=5 tid=15 WAIT

| group=“main” sCount=1 dsCount=0 s=0 obj=0x400b9bd0

| sysTid=636 nice=0 sched=0/0 handle=1014104

at java.lang.Object.wait(Native Method)

  • waiting on <0x139ba0> (a java.util.concurrent.ArrayBlockingQueue)

at java.lang.Object.wait(

at org.jivesoftware.smack.PacketWriter.nextPacket(

at org.jivesoftware.smack.PacketWriter.writePackets(

at org.jivesoftware.smack.PacketWriter.access$000(

at org.jivesoftware.smack.PacketWriter$

(break frame)

“Binder Thread #2” prio=5 tid=13 NATIVE

| group=“main” sCount=1 dsCount=0 s=0 obj=0x400b1098

| sysTid=634 nice=0 sched=0/0 handle=1314520

at Method)

(break frame)

“Binder Thread #1” prio=5 tid=11 NATIVE

| group=“main” sCount=1 dsCount=0 s=0 obj=0x400aa198

| sysTid=633 nice=0 sched=0/0 handle=1311160

at Method)

(break frame)

“JDWP” daemon prio=5 tid=9 VMWAIT

| group=“system” sCount=1 dsCount=0 s=0 obj=0x4005c088

| sysTid=630 nice=0 sched=0/0 handle=1307712

at Method)

(break frame)

“Signal Catcher” daemon prio=5 tid=7 RUNNABLE

| group=“system” sCount=0 dsCount=0 s=0 obj=0x40023510

| sysTid=629 nice=0 sched=0/0 handle=1296600

at Method)

(break frame)

“HeapWorker” daemon prio=5 tid=5 VMWAIT

| group=“system” sCount=1 dsCount=0 s=0 obj=0x40022b38

| sysTid=622 nice=0 sched=0/0 handle=1294000

at Method)

(break frame)

I’m afraid I really don’t have any familiarity with Android. From these code snippits and such I’m not really seeing what’s wrong.