# 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”);

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

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

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.setTo(“pubsub.myMachine”);

pubSub.setType(IQ.Type.SET);

pubSub.setPacketID(“publish1”);

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

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