Skip to main content

JXTA Startup Warnings

1 reply [Last post]
kadirb
Offline
Joined: 2008-06-18

When i try to start my server , i got these Warnings as shown below :
How can i solve this problems ? and whats that problems can someone help ?
WARNING: Stalled until there is an endpoint service
WARNING: Stalled until there is a rendezvous service
WARNING: Endpoint Router start stalled until rendezvous service available
WARNING: Failed to get RouteControl object. Resolver will not set route hints.

My Server Code :

package javaapplication3;
import java.io.IOException;
import java.net.Authenticator;
import java.net.URI;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.jxta.credential.AuthenticationCredential;
import net.jxta.discovery.DiscoveryService;
import net.jxta.document.AdvertisementFactory;
import net.jxta.document.StructuredDocument;
import net.jxta.id.IDFactory;
import net.jxta.impl.id.CBID.PeerGroupID;
import net.jxta.impl.id.binaryID.PipeBinaryID;
import net.jxta.impl.id.binaryID.DigestTool;
import net.jxta.membership.MembershipService;
import net.jxta.peergroup.PeerGroup;
import net.jxta.pipe.PipeService;
import net.jxta.platform.*;
import net.jxta.protocol.ModuleImplAdvertisement;
import net.jxta.protocol.PeerGroupAdvertisement;
import net.jxta.protocol.PipeAdvertisement;
import net.jxta.rendezvous.RendezVousService;
import net.jxta.resolver.ResolverService;
/*
Hallo,
these are the peers to be set to NetworkConfigurator
http://rdv.jxtahosts.net/cgi-bin/relay.cgi?2
http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2
*/
public class Main implements Runnable {

public static String SUBGROUPURN = "urn:jxta:uuid-3E2406ADF2E542FD87F1A9744052711602";
public static String rendezvousSeed = "tcp://61.151.238.80:9701";
public static String relaySeed = "tcp://61.151.238.80:9701";
public static String publicAddress = "61.151.238.80";

private static DigestTool digestTool = new DigestTool( );

@Override
public final void run() {
try {
Thread.currentThread().sleep(Integer.MAX_VALUE);
} catch (InterruptedException ex) {}
}

public static PipeAdvertisement getPipeAdvertisement(PeerGroup peerGroup) {
String type = PipeService.UnicastType;
String name = "ConnectionPoint";
PipeAdvertisement advertisement = (PipeAdvertisement) AdvertisementFactory.newAdvertisement(PipeAdvertisement.getAdvertisementType());
PipeBinaryID pipeID = digestTool.createPipeID(peerGroup.getPeerGroupID(), name, null);
advertisement.setPipeID(pipeID);
advertisement.setType(type);
advertisement.setName(name);

return advertisement;
}

public static void main(String[] args) {
try {
NetworkManager manager = new NetworkManager(NetworkManager.ConfigMode.RENDEZVOUS_RELAY,"SERVER");
NetworkConfigurator nc = manager.getConfigurator();
nc.setTcpEnabled(true);
nc.setUseMulticast(true);
nc.setHttpEnabled(true);
nc.setHttpIncoming(true);
nc.setHttpOutgoing(true);

nc.setRendezvousMaxClients(100);

PeerGroup peer_group = manager.startNetwork( );

ModuleImplAdvertisement ma = peer_group.getAllPurposePeerGroupImplAdvertisement( );
PeerGroup subPeerGroup = peer_group.newGroup( (PeerGroupID) IDFactory.fromURI( new URI(SUBGROUPURN) ) );
PeerGroupAdvertisement subPeerGroupAdv = subPeerGroup.getPeerGroupAdvertisement( );

DiscoveryService ds = peer_group.getDiscoveryService( );
ds.publish( subPeerGroupAdv );
ds.remotePublish( subPeerGroupAdv );

joinPeerGroup(subPeerGroup);
RendezVousService rs = subPeerGroup.getRendezVousService();
rs.startRendezVous();

//ResolverService rs2 = subPeerGroup.getResolverService();

//Thread thread = new Thread(new Main());
//thread.start();

//manager.stopNetwork();
} catch (Exception ex) {

}
}

public static void joinPeerGroup(PeerGroup subPeerGroup) {
StructuredDocument creds = null;

try {
// Generate the credentials for the Peer Group
AuthenticationCredential authCred = new AuthenticationCredential(subPeerGroup,null,creds);

// Get the MembershipService from the peer group
MembershipService membership = subPeerGroup.getMembershipService();

// Get the AuthenticatorGui from the Authentication creds
net.jxta.membership.Authenticator auth = membership.apply(authCred);

// Check if everything is okay to join the group
if (auth.isReadyForJoin()) {
membership.join(auth);
} else
System.out.println("unable to join sub PeerGroup");
} catch (Exception e) {
System.out.println("Failure in authentication");
e.printStackTrace();
}
}
}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
adamman71
Offline
Joined: 2007-01-31

Hi,

a) Your code indicates that you have not set seeds in your router. That is not dramatic, so this is why you only get a warning.

b) The following references are obsolete:

http://rdv.jxtahosts.net/cgi-bin/relay.cgi?2
http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?3

and should be replaced by:

http://rdv.jxtahosts.net/cgi-bin/relay.cgi?3
http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?3

However, these should only be used for simple test purposes. Those seeds are not always very responsive.

c) In general, it is preferable to set-up your own seeds. There is a possibility to run multiple peers on a single PC. Check code examples available at: www.practicaljxta.com.

Cheers,

J.