powered by Jive Software

Presence Available from Transport

I am registered to recieve presence updates from a transport. The transport is sending a Presence packet after it connects but I am not recieving this update in my client. Does anyone have any experience with updating a transport presence and know what I can change to fix this?

Hey Alex,

Attached to this post you will find a JM plugin that will print to the stdout the XML traffic going in and out of the server. Can you post the XML that the transport sent to the server and the packet sent from the server to any client (if any)? BTW , do you see anything in the error log files?

Regards,

– Gato

Hey Gato:

As always thanks for the help. A few things when I loaded the plugin I got a few errors:

at org.jivesoftware.messenger.container.PluginManager$PluginMonitor.run(PluginMana ger.java:555)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

2005.10.18 13:40:00 org.jivesoftware.messenger.container.PluginManager$PluginMonitor.unzipPlugin(Plu ginManager.java:687)

java.util.zip.ZipException: error in opening zip file

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.(Unknown Source)

at org.jivesoftware.messenger.container.PluginManager$PluginMonitor.unzipPlugin(Pl uginManager.java:655)

at org.jivesoftware.messenger.container.PluginManager$PluginMonitor.run(PluginMana ger.java:555)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

2005.10.18 13:40:15 org.jivesoftware.messenger.container.PluginManager$PluginMonitor.unzipPlugin(Plu ginManager.java:687)

java.util.zip.ZipException: error in opening zip file

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.(Unknown Source)

at org.jivesoftware.messenger.container.PluginManager$PluginMonitor.unzipPlugin(Pl uginManager.java:655)

at org.jivesoftware.messenger.container.PluginManager$PluginMonitor.run(PluginMana ger.java:555)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

/code

also:

I didnt have my transport connected when I first logged on and I noticed that messenger was attempting to connect to it remotely:

2005.10.18 13:43:39 OS - Trying to connect to isgateway.gw.intrasmart.com:5269

2005.10.18 13:43:47 Error connecting to the remote server: isgateway.gw.intrasmart.com(DNS lookup: isgateway.gw.intrasmart.com)

java.net.UnknownHostException: isgateway.gw.intrasmart.com

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.(Unknown Source)

at javax.net.DefaultSocketFactory.createSocket(Unknown Source)

at org.jivesoftware.messenger.server.ServerDialback.createOutgoingSession(ServerDi alback.java:130)

at org.jivesoftware.messenger.server.OutgoingServerSession.authenticateDomain(Outg oingServerSession.java:113)

at org.jivesoftware.messenger.spi.RoutingTableImpl.getRoute(RoutingTableImpl.java: 92)

at org.jivesoftware.messenger.net.SocketPacketWriteHandler.process(SocketPacketWri teHandler.java:52)

at org.jivesoftware.messenger.spi.PacketDelivererImpl.deliver(PacketDelivererImpl. java:48)

at org.jivesoftware.messenger.spi.PresenceManagerImpl.probePresence(PresenceManage rImpl.java:318)

at org.jivesoftware.messenger.handler.PresenceUpdateHandler.initSession(PresenceUp dateHandler.java:191)

at org.jivesoftware.messenger.handler.PresenceUpdateHandler.process(PresenceUpdate Handler.java:94)

at org.jivesoftware.messenger.handler.PresenceUpdateHandler.process(PresenceUpdate Handler.java:141)

at org.jivesoftware.messenger.PresenceRouter.handle(PresenceRouter.java:87)

at org.jivesoftware.messenger.PresenceRouter.route(PresenceRouter.java:61)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:73)

at org.jivesoftware.messenger.net.SocketReader.processPresence(SocketReader.java:3 01)

at org.jivesoftware.messenger.net.ClientSocketReader.processPresence(ClientSocketR eader.java:49)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:208)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:111)

at java.lang.Thread.run(Unknown Source)

/code

Hey Alex,

Is it possible that the jar file got corrupted? Can you try opening manually using WinZip or WinRar? BTW, from the stack trace I see that you are not using JM 2.3.0 beta 1. If possible, try updating to the beta 1 that provides many bug fixes and most important (in this case) it provides asyncrhonous s2s communication.

Regards,

– Gato

Okay,

I will attempt an upgrade but in the mean time here is the xml:

SENT:

/code

i notice that when i send a presence packet from smack without a from the jabber id is in the packet dump but when coming from the transport, no such luck.

Hey Alex,

I’‘m assuming that the presence packet in your transcript is coming from “component.gw.intrasmart.com” and you are expecting the server to broadcast it to your user. Is that correct? Could you check if the user has added “component.gw.intrasmart.com” to his roster and is subscribed to the “component.gw.intrasmart.com”’'s presence?

Regards,

– Gato

Hey Gato:

No, the presence packet is coming from “isgateway.gw.intrasmart.com” and that is the id that is in the contact list of the contact. component.gw.intrasmart.com is just where the server sends the disco request from, my transport has nothing to do with that. Also, I just attempted to add the id explicitly to the packet and that didn’'t make a difference.

Thanks again!

Alex

But I think what Gato is saying is that “component.gw.intrasmart.com” needs to be registered by the user to recieve notifications. If you look in the svn-org/transports, I have an example of a gateway or transport that does this all automatically. I’'ve already pulled my hair out over these issues, hopefully I can save you the same experience.

Noah

Okay,

So I subscribed to: “component.gw.intrasmart.com” but the roster stays in the state of ask=“subscribe”.

Thanks Noah:

Alex

Hey Alex,

I don’'t know which gateway are you using but it seems that the gateway has not approved the presence subscription request. Could you check if the server is getting a presence with status subscribed from the gateway?

Thanks,

– Gato

Message was edited by:

dombiak_gaston

Hey Gato:

I was originally subscribing to “isgateway.gw.intrasmart.com”, which was approving my subscription and appropriatly was listed as subscription=“to” in my roster. But then, Noah said, or at least I understood as what he said, that messenger would not forward presence along from a component so to change the subscription to “component.gw.intrasmart.com”, when I added that to my roster, and sent my subscribe packet, I was not recieving the “Subscribed” packet back from it.

Thanks,

Alex

Your gateway/transport needs to include a subscription of both in your roster, otherwise, no messages get sent from you transport. The reason for “both” is the transports needs to know when you login and when you logout. It also needs to deliver messages to your client (like disco, etc.)

Once the transport and user are subscribe=both, you should be up and running.

Noah

PS. To reiterate, please take a look at the transports project…there is a generic “gateway” class you can extend that does all this dirty work for you.

Okay,

I noticed something this time around. My gateway: isgateway.gw.intrasmart.com is in my contact list as subscribe=“to” and when my client connects it sends a probe to the gateway. My problem still exists though and I attempted to send a subscribe presence to my client, its receieved by the server:

RCV:

/code

But, its not being forwarded to my client.

Thanks,

Alex

Get your gateway registered as subscribe=“both” and you’‘ll be in business. It’‘ll also require your gateway to be smart and respond to the client’'s subscribe request. This is the only way to update roster in Messenger.

Yea,

My gateway is smart i guess it responds to the subscribe with both a subscribed and a subscribe. The subscribe packet is not passed along by the server, from my transport unless I explicitly address it. But, my original problem still exists, it does not seem my available packet is passed along unless in response to the original probe and I have another question why doesn’'t messenger pass along an unavailable automatically for my transport as it seems to do for clients when they are abrubtly terminated? If not is there any process I can take to get it to forward an unavailable and available packets to all intrested parties or am I stuck with only responding to client probes?

Thanks,

Alex