Re: [JXTA discuss] How to start the tutorial client server examples on a single machine?

Bruce Rosenthal <[email protected]> Fri, 19 Aug 2005 16:21:37 -0700
Newsgroups gmane.comp.java.jxta.general
Message-ID <[email protected]>
--------------090006070501080406020904
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

So what I just tried (pending work with the myJxta solutions using 
ext:config et al) was as discussed in an earlier thread to have two 
separate directories and therefore two separate instances of .jxta/* and 
that is working correctly after 1.) running the listener and then 2.) 
the service.

So the listener is outputing to stdout as follows:

Reading in pipexample.adv
C:\jxtaApps\PipeListener\pipexample.adv
Creating input pipe
Waiting for msgs on input pipe
------------------Begin Message---------------------
Message Size :90
Element PipeListenerMsg : 28
[Fri Aug 19 16:13:46 PDT 2005]
-------------------End Message----------------------
Message received at :Fri Aug 19 16:13:46 PDT 2005
Message  created at :Fri Aug 19 16:13:46 PDT 2005
------------------Begin Message---------------------
Message Size :90
Element PipeListenerMsg : 28
[Fri Aug 19 16:13:47 PDT 2005]
-------------------End Message----------------------
Message received at :Fri Aug 19 16:13:47 PDT 2005
Message  created at :Fri Aug 19 16:13:47 PDT 2005

And the Service as follows:

Reading in pipexample.adv
C:\jxtaApps\PipeService\pipexample.adv
Attempting to create a OutputPipe
Waiting for Rendezvous Connection
 Got an output pipe event
Sending message
message sent
Connected to Rendezvous, attempting to create a OutputPipe
 Got an output pipe event
Sending message
message sent

James Todd wrote:

> >Please, please, someone contact whomever is responsible for the jxta 
> auto config process and >ask him to include a tcp port availability 
> check (it should be simple, just loop over >ServerSockets and 
> IOExceptions until you find an open port).
>
> ext:config and JXTA core does support auto selction of available ports 
> for TCP endpoints:
>
>  http://wiki.java.net/bin/view/Jxta/ExtConfig
>
> Compilable code samples are included in:
>
>  Resources :: 2. ext-config.zip
>
> Further, MyJXTA (http://myjxta2.jxta.org) uses (and is in fact the 
> source of) ext:config
> proper. So, to see ext:config in practice via at least one application 
> consider:
>
>  home: http://myjxta2.jxta.org
>  jnlp: http://download.jxta.org/build/nightly/jnlp/myjxta.jnlp
>          http://download.java.net/lg3d/jxta/jnlp/myjxta-beta.jnlp
>
> hth,
>
> - james
>
> -- 
> Alex Lynch wrote:
>
>> Dont change the ports on both peers to the same thing. Make them 
>> different or they will collide.
>> This problems should be detected and avoided by the configuration 
>> optimizers. This is a very important problem, because it causes many 
>> newbie testers to think that jxta doesn't work.
>>
>> Please, please, someone contact whomever is responsible for the jxta 
>> auto config process and ask him to include a tcp port availability 
>> check (it should be simple, just loop over ServerSockets and 
>> IOExceptions until you find an open port).
>>
>> Thanks,
>>
>> Alex
>>
>> Hartmut Benz wrote:
>>
>>> Hi,
>>>
>>> Both peers default to the same ports...
>>> From memory:
>>> Clean out one of the directories (the .jxta) and start again.
>>> When the configuration screen comes up, go to the "advances" tab 
>>> and  change the two instances of 9701 to something else, e.g. 19701.
>>> Hartmut
>>>
>>> On Thu, 18 Aug 2005 21:13:53 +0200, Bikash Agarwalla  
>>> <[email protected]> wrote:
>>>
>>>> Sorry if you receive multiple copies - I have trying the example  
>>>> included in the jxta programmer tutorial - "PipeService". I keep 
>>>> getting  the error "java.net.BindException: Address already in use
>>>> " when I run the client and server on the same machine. I have 
>>>> tried to  run the client and server from different directories (as 
>>>> recommended in  the tutorial), but I still get the same error as 
>>>> follows:
>>>> "<FATAL 2005-08-18 15:12:29,527  
>>>> IncomingUnicastServer::openServerSocket:368> Cannot bind 
>>>> ServerSocket on  /0.0.0.0:9701"
>>>>
>>>> It seems both client and server are trying to bind to port 9701 for 
>>>> the  default peer group initialization. How do I get around this 
>>>> problem?
>>>>
>>>> Thanks for your help.
>>>> Bikash
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>


--------------090006070501080406020904
Content-Type: text/plain; charset=us-ascii

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--------------090006070501080406020904--