Introduction to JXTA 2.6 Peer Detection and Pipe Messaging
The guide I would like to have 2 months ago =)
After spending a lot of time while creating a university course, the JXTA p2p app, I feel a lot of frustrations and confusion that I encountered could be avoided with a good starting point.
The jar files you need can be found here:
https://oss.sonatype.org/content/repositories/comkenaijxse-057/com/kenai/jxse/jxse/2.6/jxse-2.6.jar
http://sourceforge.net/projects/practicaljxta/files/lib-dependencies-2.6.zip/download
Drop them into your / lib project, open eclipse, create a new project "Yourproject" and it should figure it out by importing the libraries for you.
You will soon realize that almost any information on the Internet is out of date, very out of date. You will also come across many very confusing error messages, and most of them can be avoided through this checklist.
Is your firewall disabled or at least open to the ports you are using? You can disable iptables with "sudo service iptables stop" in Fedora.
Check your spelling! Many times, when you join groups or try to send messages by saying the wrong group name or not using exactly the same advertising when looking for peers and services or opening pipes, it will cause very confusing messages. I tried to find out why my pipe connections ended when I noticed group names that are "Net info" and "Net_info".
Do you use the JXTA home directory? One for each peer computer that you run on the same computer?
Are you really using a unique peer identifier? The seed provided by IDFactory must be long enough, otherwise you will get duplicates.
Disable SELinux. I had SELinux turned off during development, but might imagine that it is causing errors.
While it is usual to group all fields together, I introduce them when I go to show where they are needed.
Note. This will not work in version 2.7. I think there is some issue with PSE membership.
public class Hello implements DiscoveryListener, PipeMsgListener {
source share