Skip to main content

startNetwork() error

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
cocol
Offline
Joined: 2006-05-05

hello!
i am completly new at jxta,so i search at hte internet and download several tutorial,so what i can do that create or test some codes at my eclipse by adding jxta.jar as an external archive,so the code show no error,but when i run the code several exception occured in startNetwork() function,i know i am missing something about jxta configuration but i don't know what to do.
thank you for your help.

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

Check the developers guide or the Practical JXTA II book available online for reading on Scribd.
Jérôme

fra86co
Offline
Joined: 2011-01-18

Are you sure they are errors?
JXTA write log many information on standard error output stream.

cocol
Offline
Joined: 2006-05-05

hello again.
in the example helloWorld and any other example this is the output:
<code>
import net.jxta.platform.NetworkManager;
import java.text.MessageFormat;
import java.io.File;

/**
* A example of strating and stopping JXTA
*/
public class HelloWorld {

/**
* Main method
*
* @param args none defined
*/
public static void main(String args[]) {
NetworkManager manager = null;

try {
manager = new NetworkManager(NetworkManager.ConfigMode.ADHOC, "HelloWorld", new File(new File(".cache"), "HelloWorld").toURI());
System.out.println("Starting JXTA");
manager.startNetwork();
System.out.println("JXTA Started");
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
System.out.println("Waiting for a rendezvous connection");
boolean connected = manager.waitForRendezvousConnection(12000);

System.out.println(MessageFormat.format("Connected :{0}", connected));
System.out.println("Stopping JXTA");
manager.stopNetwork();
}
}
</code>
and the output:
Starting JXTA
Mar 7, 2011 12:59:09 AM net.jxta.impl.membership.pse.PSEUtils <init>
INFO: Loaded Security Providers into system class loader
Mar 7, 2011 12:59:09 AM net.jxta.platform.NetworkManager configure
INFO: Loading existing configuration. mode = EDGE
Mar 7, 2011 12:59:09 AM net.jxta.platform.NetworkManager startNetwork
INFO: Starting JXTA Network! MODE = EDGE, HOME = file:/C:/java/Helloworld1%20jxta/.jxta/
Mar 7, 2011 12:59:09 AM net.jxta.impl.peergroup.StdPeerGroup isCompatible
WARNING: Failure handling compatibility statement
java.lang.NumberFormatException: Empty version string
at java.lang.Package.isCompatibleWith(Unknown Source)
at net.jxta.impl.peergroup.StdPeerGroup.isCompatible(StdPeerGroup.java:426)
at net.jxta.impl.peergroup.GenericPeerGroup$1.compatible(GenericPeerGroup.java:148)
at net.jxta.impl.loader.RefJxtaLoader.findClass(RefJxtaLoader.java:254)
at net.jxta.impl.loader.RefJxtaLoader.findModuleImplAdvertisement(RefJxtaLoader.java:350)
at net.jxta.impl.peergroup.StdPeerGroup.getDefaultModuleImplAdvertisement(StdPeerGroup.java:325)
at net.jxta.impl.peergroup.StdPeerGroup.<clinit>(StdPeerGroup.java:143)
at net.jxta.peergroup.WorldPeerGroupFactory.getDefaultWorldPeerGroupClass(WorldPeerGroupFactory.java:237)
at net.jxta.peergroup.WorldPeerGroupFactory.<init>(WorldPeerGroupFactory.java:178)
at net.jxta.peergroup.NetPeerGroupFactory.<init>(NetPeerGroupFactory.java:205)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:410)
at HelloWorld.main(HelloWorld.java:17)
Mar 7, 2011 12:59:09 AM net.jxta.impl.loader.RefJxtaLoader findModuleImplAdvertisement
WARNING: Failed to find class for urn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE000000080106
java.lang.ClassNotFoundException: urn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE000000080106
at net.jxta.impl.loader.RefJxtaLoader.findClass(RefJxtaLoader.java:259)
at net.jxta.impl.loader.RefJxtaLoader.findModuleImplAdvertisement(RefJxtaLoader.java:350)
at net.jxta.impl.peergroup.StdPeerGroup.getDefaultModuleImplAdvertisement(StdPeerGroup.java:325)
at net.jxta.impl.peergroup.StdPeerGroup.<clinit>(StdPeerGroup.java:143)
at net.jxta.peergroup.WorldPeerGroupFactory.getDefaultWorldPeerGroupClass(WorldPeerGroupFactory.java:237)
at net.jxta.peergroup.WorldPeerGroupFactory.<init>(WorldPeerGroupFactory.java:178)
at net.jxta.peergroup.NetPeerGroupFactory.<init>(NetPeerGroupFactory.java:205)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:410)
at HelloWorld.main(HelloWorld.java:17)
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.jxta.peergroup.WorldPeerGroupFactory.getDefaultWorldPeerGroupClass(WorldPeerGroupFactory.java:237)
at net.jxta.peergroup.WorldPeerGroupFactory.<init>(WorldPeerGroupFactory.java:178)
at net.jxta.peergroup.NetPeerGroupFactory.<init>(NetPeerGroupFactory.java:205)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:410)
at HelloWorld.main(HelloWorld.java:17)
Caused by: java.lang.IllegalArgumentException: Illegal module
at net.jxta.impl.peergroup.StdPeerGroupParamAdv.addService(StdPeerGroupParamAdv.java:188)
at net.jxta.impl.peergroup.StdPeerGroup.getDefaultModuleImplAdvertisement(StdPeerGroup.java:326)
at net.jxta.impl.peergroup.StdPeerGroup.<clinit>(StdPeerGroup.java:143)
... 5 more

so all class i run that contain startNetwork function,do the same output,i tried everything i can do,and no results.
also i tried in windows XP because i am using windows 7,and no result,the same problem or exception,and i don't know what can i do.
thank you again!