Skip to main content

Problem running pipe service and client tutorial program

1 reply [Last post]
spsarolkar
Offline
Joined: 2009-08-20

I am trying out pipe service and client tutorial program. I am not sure where I am going wrong.
I have pipeClient.bat file as well as source folder in
C:\jxse-tutorials-2.5>
and pipeServer.bat file as well as source folder in
E:\xse-tutorials-2.5>

But server Cant receive any message It just says

Waiting for msgs on input pipe

and halts

On client side i get last few messages as

WARNING: Unhandled Element: net.jxta.impl.document.LiteXMLElement@d3db51 / isOff = <>
Aug 25, 2009 4:45:01 PM net.jxta.platform.NetworkManager startNetwork
INFO: Started JXTA Network!

and it doesnt do anything

Please help me get going..

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
msugar1970
Offline
Joined: 2010-01-09

Yes, same thing here. I'm assuming you are using JXTA 2.5 as well.

I'm a JXTA newbie, but it seems that warning is not related to the problem's root cause.

It seems that PipeServer.java halts because it is still waiting for the incoming messages, which in this case has a very small chance of occurring due a problem with PipeClient.java (explained next). Note that the PipeServer's "stop" method is not called by anyone, so I believe this code was adapted from an interactive application with a GUI that allowed the user to choose when to finish the program. (See, for example, the code found in chapter 8 of http://www.brendonwilson.com/projects/jxta-book/.)

The problem with PipeClient is that the message is sent asynchronously (by net.jxta.impl.pipe.NonBlockingOutputPipe's "send" method) but the program proceeds right away and *can* close the pipe before the whole message is really delivered. Note the the "close" method is also asynchronous. In another words, the "message sent" shown in the console is misleading: the sending process is not instantaneous.

Therefore, depending on your luck, you can face some other undesirable outcomes, like the client waiting forever or the server throwing ugly IO exceptions. On the other hand, due to its multithreading nature, the code can behave correctly in a different machine or configuration.

If i am right about all this, I hope the crew programming the 2.6 version of JXSE has already fixed the problem.

Of course, the probability I'm ill-informed is great. Take it with a huge grain of salt... By the way, anyway would like to recommend some very good documentation about the newer JXTA implementation, JXSE 2.6?