powered by Jive Software

Publish information in the node. is this code correct?

I want to publish information in the node that i have create(server:OpenFire,library: smack, su-smack) but i have error .Can you help me to find my error please?

Code:

static void publish()

{

PubSub pubSub = new PubSub();

pubSub.setTo(“pubsub.myMachine”);

pubSub.setType(IQ.Type.SET);

PublishElement pub = new PublishElement(“TheNode”);

pubSub.addChild(pub);

pub.addChild(new ItemElement(null,"

Exception in thread “Smack Packet Reader” java.lang.NoClassDefFoundError: org/apache/commons/collections/ArrayStack

at se.su.it.smack.provider.ProviderSupport.parseElement(ProviderSupport.java:28)

at se.su.it.smack.provider.PubSubProvider.parseIQ(PubSubProvider.java:25)

at org.jivesoftware.smack.PacketReader.parseIQ(PacketReader.java:603)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:289)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63)

Looks like it can’'t find the jakarta-commons jar(s) on your classpath

Hi,

i have corect my code, i have no exception and no bad request, here is the code to publish:

static void publish()

{

PubSub pubSub = new PubSub();

pubSub.setFrom(“admin@myMachine/Smack”);

pubSub.setTo(“pubsub.myMachine”);

pubSub.setType(IQ.Type.SET);

pubSub.setPacketID(“publish1”);

PublishElement pub = new PublishElement("/Node");

pubSub.addChild(pub);

pub.addChild(new ItemElement(“punlish1”,"Before publish i have that:

|-Publish-Subscribe services

|----


/Node

->After publishing i have that:

|-Publish-Subscribe services

|----


/Node

|----


Publish-Subscribe services

|----


/Node

|----


Publish-Subscribe services

|----


/Node

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

I do not know where is the error I however followed the XEP0060 http://www.xmpp.org/extensions/xep-0060.html#publisher

Please help me to find my error.

(i use libraries:smack and su-smack, server Openfire, language Java(eclipse))

Hi,

Were you able to solve your problems? I ran into the same but I think it’s a presentation problem of Psi.

I’ll try to do some further testing but i thougth I should ask you before contiuing.

Andreas