Skip to main content

HelloWorld - ClassNotFoundException: urn:jxta:uuid-DEADBEEFDEAFBABAFEEDB...

10 replies [Last post]
stodge
Offline
Joined: 2005-05-06
Points: 0

I'm just starting out with jxta and I fell at the first hurdle. I'm trying to run the HelloWorld tutorial in Eclipse but I'm getting this when I run:

Starting JXTA
Apr 3, 2009 8:45:17 AM net.jxta.platform.NetworkManager configure
INFO: Created new configuration. mode = ADHOC
Apr 3, 2009 8:45:17 AM net.jxta.platform.NetworkManager startNetwork
INFO: Starting JXTA Network! MODE = ADHOC, HOME = file:/C:/Documents%20and%20Settings/stodge/workspace/jxta/.cache/HelloWorld
Apr 3, 2009 8:45:17 AM net.jxta.impl.protocol.RelayConfigAdv
WARNING: Unhandled Element: net.jxta.impl.document.LiteXMLElement@1ff5ea7 / isOff = <>
Apr 3, 2009 8:45:17 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.(StdPeerGroup.java:143)
at net.jxta.peergroup.WorldPeerGroupFactory.getDefaultWorldPeerGroupClass(WorldPeerGroupFactory.java:237)
at net.jxta.peergroup.WorldPeerGroupFactory.(WorldPeerGroupFactory.java:178)
at net.jxta.peergroup.NetPeerGroupFactory.(NetPeerGroupFactory.java:205)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:410)
at tutorial.HelloWorld.main(HelloWorld.java:80)
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.jxta.peergroup.WorldPeerGroupFactory.getDefaultWorldPeerGroupClass(WorldPeerGroupFactory.java:237)
at net.jxta.peergroup.WorldPeerGroupFactory.(WorldPeerGroupFactory.java:178)
at net.jxta.peergroup.NetPeerGroupFactory.(NetPeerGroupFactory.java:205)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:410)
at tutorial.HelloWorld.main(HelloWorld.java:80)
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.(StdPeerGroup.java:143)
... 5 more

I've added the shell jar to the run classpath in Eclipse - is there something else I've forgotten?

This is the HelloWorld code:

package tutorial;

import net.jxta.platform.NetworkManager;
import java.text.MessageFormat;
/**
* A example of starting 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.EDGE, "HelloWorld");
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();
}
}

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
origama
Offline
Joined: 2007-04-19
Points: 0

mmm..... can you tell what version of JDK are you working with?

I think that the error could depend on it.

stodge
Offline
Joined: 2005-05-06
Points: 0

Good point - it's 1.5.0. I could install a newer version and see if that makes a difference.

andrwe2486
Offline
Joined: 2009-05-07
Points: 0

There is actually an easy way to remove the ClassNotFoundException: urn:jxta:uuid-DEAD..... meassage. It has something to do with the jxtashell.jar file. If your using an IDE you need to add the jxtashell.jar file to the library. In NetBeans you can add the jxtashell.jar to your JXTA library that you should have created or you if you already have an existing project that uses the JXTA library it might not recognize it right away so you can click on your project and right click the library folder and go add JAR and add the jxtashell.jar file. I'm sure its pretty similiar in Eclipse, just need to add jxtashell.jar to the project library in some way.

andrwe2486
Offline
Joined: 2009-05-07
Points: 0

NOTE: That jxtashell.jar file should be in the default install directory jxta/lib with the jxta.jar file.

stodge
Offline
Joined: 2005-05-06
Points: 0

Thanks - that fixed it. I installed verison 6 and it works now. I already marked your post as helpful and it seems I can't mark it as the correct answer. Sorry. :(

stodge
Offline
Joined: 2005-05-06
Points: 0

I think so. I'm using Eclipse so I modified my run configuration for my project. I added the external Jars to the ClassPath tab:

- org.mortbay.jetty.jar
- jxtashell.jar
- jxta.jar
- javax-servlet.jar
- bcprov-jdk14.jar

Is this correct? If not, how do I configure Eclipse? I must be missing something obvious.

Thanks

origama
Offline
Joined: 2007-04-19
Points: 0

the packages you are importing are correct. I use Netbeans so I don't know how to help you, but I know that there is a plugin for eclipse

https://jxta-eclipse.dev.java.net/

you could take a look and say if it works.

origama
Offline
Joined: 2007-04-19
Points: 0

Hi,
it is a known issue, this happens because the jxta environment try to load the shell jar. You can safely ignore it.
it will be removed in the next release.

If you want to obtain a clean output see http://forums.java.net/jive/thread.jspa?messageID=320423&#320423

Bye.

stodge
Offline
Joined: 2005-05-06
Points: 0

Thanks but there appear to be several issues:

1) WARNING: Failed to find class for urn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE000000080106

2) java.lang.ClassNotFoundException: urn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE000000080106

3) Exception in thread "main" java.lang.ExceptionInInitializerError

4) Caused by: java.lang.IllegalArgumentException: Illegal module

I know I can ignore the warning, but the exceptions are confusing me.

Thanks

origama
Offline
Joined: 2007-04-19
Points: 0

I have copied and pasted the code you posted and I don't get any exception.

Are you sure you've correctly configured you paths?