Réf. : RE: [JXTA user] Auto Configurator, change default port 9701 to another

Cyrille FOLLEAU <[email protected]> Tue, 6 Sep 2005 14:48:41 +0200
Newsgroups gmane.comp.java.jxta.user
Message-ID <OFE839D580.B3609B98-ONC1257074.004446DA-C1257074.00466547@ds-fr.com>
thanks,

I suppose you forgot something (because tcpTransport is not used, and I've 
got a ClassCastException :) )

I've tried this :

Configurator configurator= new 
Configurator("myName,"","login","password"); 
Configurator.setHome(_jxtaHome);
TcpTransport tcpTransport = new TcpTransport();
URI uri = URI.create("tcp://"+IP+":"+3001);
TcpTransportAddress add = new TcpTransportAddress();
add.setAddress(uri);
tcpTransport.addAddress(add); // <-- I suppose it's the right syntax
Vector transport = new Vector();
transport.add(tcpTransport); // <-- I suppose it's the right syntax 
configurator.setTransports(transport);
configurator.save();


I've got the following error at configurator.save() :

java.lang.IllegalStateException: Multicast enabled and no address 
specified.
        at net.jxta.impl.protocol.TCPAdv.getDocument(TCPAdv.java:719)
        at 
net.jxta.ext.config.Configurator.constructPlatformConfig(Configurator
.java:3403)
        at 
net.jxta.ext.config.Configurator.getPlatformConfig(Configurator.java:
1453)
        at net.jxta.ext.config.Configurator.save(Configurator.java:1644)
        at net.jxta.ext.config.Configurator.save(Configurator.java:1632)

It needs a Multicast  address and port, but it didn't need it before !
It's strange. How can I provide a multicast address ?

And after the graphical Configurator opens !!! (only peer name is 
available on Basic settings tab)
In advanced tab, there is still port 9701. 

Did you have this issue ?

Is there anyone who already tried to automatically change the TCP port ?

Regards
Cyrille





"Faisal Khan" <[email protected]>
05/09/2005 19:03
Veuillez répondre à user
 
        Pour :  <[email protected]>
        cc :    (ccc : Cyrille FOLLEAU/dassault-systemes)
        Objet : RE: [JXTA user] Auto Configurator, change default port 
9701 to         another


Hi Cyrille,
 
Here is what I did to change tcp address and port in Configurator
 
TcpTransport tcpTransport = new TcpTransport();
            String ip = “ip address”
            String port = “port number”
            TcpTransportAddress add = new TcpTransportAddress();
            URI uri = URI.create ("tcp://"+ip+":"+port);
            add.setAddress (uri); 
            Vector transport = new Vector();
            transport.add (add);
            configurator.setTransports (transport); 
 
You can also configure HTTP transport in the same way; just add it to the 
transport vector.
 
Hope it solves your problem.
 
Regards
Faisal Khan
 

From: Cyrille FOLLEAU [mailto:[email protected]] 
Sent: Monday, September 05, 2005 2:24 PM
To: [email protected]
Subject: [JXTA user] Auto Configurator, change default port 9701 to 
another
 

Hello, 

I use auto configurator at each application start (after each reboot) 
because there is DHCP and Ip Address can change. 
And user don't have to see configurator. 
It works fine : 
Configurator configurator= new 
Configurator("myName,"","login","password"); 
configurator.setHome(jxtaHome); 
configurator.save(); 

But I would like to change the default TCP/IP port, I can't use 9701, I 
must use 3001. 

How can I change this port (and the incoming connexion which is the same) 

I looked at PlatformConfig and Configurator but I didn't see what I want 
:( 

#####################
Cyrille Folleau
Ingenieur Informatique
Tel : 01 41 38 42 37
Dassault Data Services
22 quai Gallieni
92156 Suresnes Cedex