Archive for December 2003

 
 

JXTA is up and running

After several hours of messing with libraries, ant, eclipse and my Java environment I managed to get a build with basic JXTA support running. I tried so many different things that I think its worth noting some of the more obscure tricks I found online to get things working. Its also worth noting that doing this sort of �debugging� is very annoying and I�m not sure that its really programming, more configuration management.

  • To get ant to compile your source in eclipse you need to let it know where the tools.jar file is. Got to Window->Preferences->ant->Runtime. Add tools.jar to the Runtime Classpath.
  • You need several libraries to make Jxta work that are not on the project download page. Download one of the binary install packages instead, this contains the libraries you need, as pointed out in the Project JXTA 2.0: Java Programmer�s Guide on page 24.
  • Set your JAVA_HOME, mine wasn�t set and this caused problems with running ant at the command line.
  • When JXTA starts up (actually when you create the Net Peer Group) it shows the big nasty configurations dialog. This is good for me because I don�t have to write my own. Its also good for beta testers because the configuration is saved and you wont be prompted for it when you upgrade.

Ant 1.6 is out, with improved FTP support, something I am interested in for automated drops to this website. Ant 1.6 wont work with Eclipse 2.1.2, it gives an error:

BUILD FAILED: java.lang.NoSuchMethodError:
org.apache.xerces.xni.parser.XMLComponent.getFeatureDefault(Ljava/lang/String;)Ljava/lang/Boolean;

If anyone knows a fix for this let me know.

Next its on to doing things with groups. Listing groups, joining groups, creating groups and listing members of group.

GlobalConfig.cfg

I spent a day building a configuration registry system for Mindshare. Basically it�s a wrapper for the java.utils.Properties class. It allows you to get and set values that are strings, bools or ints, which is convenient. A single abstract class handles all the file access code. If you get or set a non existent member an assert is triggered. It can even automatically upgrade configuration files if the keys in the current file don�t match the expected set of keys. This will be great when I start changing the config files and ship incompatible versions to testers, they won�t even notice things changed.

This config work was necessary for doing basically everything that the windows registry can do: save GUI element positions, save network settings, save peer identification info and so on.

Next up on the agenda is getting mindshare to connect to the Jxta network and join the world group. This requires some upfront work to configure the peer. It needs to know where the rendezvous and relay peers are. Luckily Jxta.org has a simple solution for this; you can pull them down from their web server via a cgi script:
Rendezvous Peers
Relay Peers

Tomorrow I�m going to write the code to fetch these lists and continue reading though the Jxta book.

Moving Forward with Mindshare

Mindshare stuff is now over here.
Currently the test GUI is available and not much else. I went with Swing/AWT for
the GUI because of my familiarity with it and my frustration with the lack of
documentation for SWT. If SWT gets its act
together I would defiantly jump ship, fast native, cross platform GUI’s are
where its at.

So next on the agenda for Mindshare is to get it on the
Jxta network. Jxta doesn’t have a peer ‘auto
configure’ system yet. Most P2P software can detect the resources and network
type on the node and configure itself accordingly. Since auto configure is on
the short list of features for the next version of Jxta I’m not going to
implement that. The Mindshare alpha will come with a generic well connected node
profile and you’ll have to mess with the settings on your own, in a text file,
to change your configuration. When auto configure becomes available in the
spring ill upgrade to that version of Jxta.

The first network test will be a group chat program built into the existing
GUI. This spike will prove several things:

  • Peers can bootstrap themselves on the network from a configuration file.
  • Peers can find a peer group they ‘want’ to join or create it if it cant be
    found.
  • Peers can open pipes to one another.
  • Peers can send XML encoded messages inside the Jxta message envelope.
  • Peers can decode messages received in XML format.
  • Peers can sense the ‘presence’ of other peers.

Look for an alpha test announcement sometime before the new year. Ill send
e-mail to all those that have expressed interest in helping with alpha testing.
Its been a rough few weeks here but now I’m getting psyched about the project
again.