JXTA-P2P开发平台基本API使用 java基本api

1. 安装配置JDK:jdk-6u33-windows-i586
2. 安装配置Eclipse:eclipse-java-indigo-SR2-win32
3. 下载JXTA开发包:jxse-src-2.5.zipjxse-lib-2.5.zipjxse-tutorials-src-2.5.zipjxse-doc-2.5.zip
4. 解压缩得到jar文件:将jxse-lib-2.5.zip中解压得到的4个文件:bcprov-jdk14.jarjavax.servlet.jarjxta.jarorg.mortbay.jetty.jar复制到任意目录,我放在eclipse安装目录下新建的目录3rdjxta中。
5. 创建Eclipse工程:【文件】->【新建】->【Java项目】->【项目名:jxta_helloworld】->【下一步】->【库标签】->【添加外部JAR】->【选择解压缩得到的4个jar文件】->【完成】
6. 新建package包:【jxta_helloworld工程右键】->【新建】->【包】->【名称:tutorial.helloworld】->【完成】
7. 新建java源文件:【tutorial.helloworld包右键】->【新建】->【类】->【名称:HelloWorld】->【完成】
8. 编辑源代码:注意:此源代码来源于jxse-tutorials-src-2.5.zip解压缩得到的src/tutorial/helloworld/HelloWorld.java文件,其他工程也都可用来运行测试。package tutorial.helloworld;
import net.jxta.platform.NetworkManager;import java.text.MessageFormat;import java.io.File;
public class HelloWorld {
public static voidmain(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 rendezvousconnection"); boolean connected =manager.waitForRendezvousConnection(12000);
System.out.println(MessageFormat.format("Connected :{0}",connected)); System.out.println("Stopping JXTA"); manager.stopNetwork(); }}
9. 运行程序:【运行】->【运行方式】->【Java 应用程序】
10. 运行结果:工程根目录将产生文件夹.cache,控制台输出:Starting JXTA2012-7-16 17:32:27 net.jxta.platform.NetworkManagerconfigure信息: Loading existing configuration. mode = ADHOC2012-7-16 17:32:27 net.jxta.platform.NetworkManagerstartNetwork信息: Starting JXTA Network! MODE = ADHOC,HOME =file:/D:/eclipse/workspace/jxta_tutorial_helloworld/.cache/HelloWorld/2012-7-16 17:32:27 net.jxta.impl.protocol.RelayConfigAdv<init>警告: Unhandled Element:net.jxta.impl.document.LiteXMLElement@12498b5 / isOff =<<nullvalue>>2012-7-16 17:32:27 net.jxta.impl.loader.RefJxtaLoaderfindModuleImplAdvertisement警告: No class forurn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE0000000C02062012-7-16 17:32:27 net.jxta.peergroup.WorldPeerGroupFactorynewWorldPeerGroup信息: Making a new World Peer Group instance using :net.jxta.impl.peergroup.Platform2012-7-16 17:32:27 net.jxta.impl.cm.SrdiIndex clearSrdi信息: Clearing SRDI for null2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Always Access Service(net.jxta.impl.access.always.AlwaysAccessService)2012-7-16 17:32:27net.jxta.impl.endpoint.tcp.IncomingUnicastServeropenServerSocket信息: Server will accept connections at /0.0.0.0:97012012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theTCP Message Transport(net.jxta.impl.endpoint.tcp.TcpTransport)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRendezvous Service(net.jxta.impl.rendezvous.RendezVousServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of thePeerinfo Service (net.jxta.impl.peer.PeerInfoServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theEndpoint service (net.jxta.impl.endpoint.EndpointServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : None Membership Service(net.jxta.impl.membership.none.NoneMembershipService)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theResolver service (net.jxta.impl.resolver.ResolverServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theDiscovery service(net.jxta.impl.discovery.DiscoveryServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theIP Multicast Message Transport(net.jxta.impl.endpoint.mcast.McastTransport)2012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstartApp警告: Stalled until there is an endpoint service2012-7-16 17:32:27net.jxta.impl.rendezvous.RendezVousServiceImpl startApp警告: Stalled until there is an endpoint service2012-7-16 17:32:27 net.jxta.impl.peer.PeerInfoServiceImplstartApp警告: Stalled until there is a resolver service2012-7-16 17:32:27 net.jxta.impl.endpoint.EndpointServiceImplstartApp信息: Endpoint Service started.2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl startApp警告: Stalled until there is a rendezvous service2012-7-16 17:32:27 net.jxta.impl.endpoint.mcast.McastTransportstartApp信息: IP Multicast Message Transport started.2012-7-16 17:32:27net.jxta.impl.endpoint.tcp.TcpTransport$MessengerSelectorThreadrun信息: MessengerSelectorThread polling started2012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstartApp信息: TCP Message Transport started.2012-7-16 17:32:27net.jxta.impl.endpoint.tcp.IncomingUnicastServer run信息: Server is ready to accept connections2012-7-16 17:32:27net.jxta.impl.rendezvous.adhoc.AdhocPeerRdvService<init>信息: RendezVous Service is initialized forurn:jxta:jxta-WorldGroup as an ad hoc peer.2012-7-16 17:32:27net.jxta.impl.rendezvous.RendezVousServiceImpl startApp信息: Rendezvous Serivce started2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl beEdge信息: Switched to a Edge peer role.2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl startApp信息: Discovery service started2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupgetInterface信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT INCREMENTED TO:1 bynet.jxta.peergroup.NetPeerGroupFactory.<init>(NetPeerGroupFactory.java:206)2012-7-16 17:32:27 net.jxta.peergroup.NetPeerGroupFactorynewNetPeerGroup信息: Instantiating net peer group :urn:jxta:jxta-NetGroupParent : urn:jxta:jxta-WorldGroup "World PeerGroup"[1]ID : urn:jxta:jxta-NetGroupName : NetPeerGroupimpl : null2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupgetInterface信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT INCREMENTED TO:2 bynet.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:652)2012-7-16 17:32:27 net.jxta.impl.cm.SrdiIndex clearSrdi信息: Clearing SRDI for NetPeerGroup2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theJXME Proxy Service (net.jxta.impl.proxy.ProxyService)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : PSE Membership Service(net.jxta.impl.membership.pse.PSEMembershipService)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of thePipe Service (net.jxta.impl.pipe.PipeServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRouter Message Transport(net.jxta.impl.endpoint.router.EndpointRouter)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Always Access Service(net.jxta.impl.access.always.AlwaysAccessService)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRendezvous Service(net.jxta.impl.rendezvous.RendezVousServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theEndpoint service (net.jxta.impl.endpoint.EndpointServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of thePeerinfo Service (net.jxta.impl.peer.PeerInfoServiceImpl)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theCryptobased-ID Message Transport(net.jxta.impl.endpoint.cbjx.CbJxTransport)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theResolver service (net.jxta.impl.resolver.ResolverServiceImpl)2012-7-16 17:32:27 net.jxta.impl.endpoint.tls.TlsTransport<init>信息: Adjusting TLS connection idle timeout to 300000millis.2012-7-16 17:32:27 net.jxta.impl.endpoint.tls.TlsTransport<init>信息: Adjusting TLS min reconnection idle to 60000 millis.2012-7-16 17:32:27 net.jxta.impl.endpoint.tls.TlsTransport<init>信息: Adjusting TLS maximum retry queue age to 120000millis.2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theTLS Message Transport(net.jxta.impl.endpoint.tls.TlsTransport)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theDiscovery service(net.jxta.impl.discovery.DiscoveryServiceImpl)2012-7-16 17:32:27 net.jxta.impl.proxy.ProxyServicestartApp警告: Stalled until there is a endpoint service2012-7-16 17:32:27net.jxta.impl.membership.pse.PSEMembershipService startApp信息: PSE Membmership Service started.2012-7-16 17:32:27 net.jxta.impl.pipe.PipeServiceImplstartApp警告: Stalled until there is an endpoint service2012-7-16 17:32:27net.jxta.impl.endpoint.router.EndpointRouter startApp警告: Stalled until there is an endpoint service2012-7-16 17:32:27net.jxta.impl.rendezvous.RendezVousServiceImpl startApp警告: Stalled until there is an endpoint service2012-7-16 17:32:27 net.jxta.impl.endpoint.EndpointServiceImplstartApp信息: Endpoint Service started.2012-7-16 17:32:27 net.jxta.impl.peer.PeerInfoServiceImplstartApp警告: Stalled until there is a resolver service2012-7-16 17:32:27 net.jxta.impl.endpoint.cbjx.CbJxTransportstartApp信息: CbJxTransport started2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl startApp警告: Stalled until there is a rendezvous service2012-7-16 17:32:27 net.jxta.impl.proxy.ProxyServicestartApp警告: Stalled until there is a discovery service2012-7-16 17:32:27 net.jxta.impl.pipe.PipeServiceImplstartApp警告: Stalled until there is a rendezvous service2012-7-16 17:32:27net.jxta.impl.endpoint.router.EndpointRouter startApp警告: Endpoint Router start stalled until rendezvous serviceavailable2012-7-16 17:32:27net.jxta.impl.rendezvous.adhoc.AdhocPeerRdvService<init>信息: RendezVous Service is initialized forurn:jxta:jxta-NetGroup as an ad hoc peer.2012-7-16 17:32:27net.jxta.impl.rendezvous.RendezVousServiceImpl startApp信息: Rendezvous Serivce started2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl beEdge信息: Switched to a Edge peer role.2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl startApp信息: Discovery service started2012-7-16 17:32:27 net.jxta.impl.proxy.ProxyServicestartApp警告: Stalled until there is a pipe service2012-7-16 17:32:27 net.jxta.impl.cm.SrdiIndex<init>信息: [urn:jxta:jxta-NetGroup "NetPeerGroup"[0] /urn:jxta:jxta-WorldGroup "World PeerGroup"[2]] : InitializedpipeResolverSrdi2012-7-16 17:32:27 net.jxta.impl.cm.SrdiIndex startGC信息: [urn:jxta:jxta-NetGroup "NetPeerGroup"[0] /urn:jxta:jxta-WorldGroup "World PeerGroup"[2]] : Starting SRDI GCThread for pipeResolverSrdi2012-7-16 17:32:27 net.jxta.impl.cm.SrdiIndex<init>信息: [urn:jxta:jxta-NetGroup "NetPeerGroup"[0] /urn:jxta:jxta-WorldGroup "World PeerGroup"[2]] : InitializedrouterSrdi2012-7-16 17:32:27net.jxta.impl.endpoint.router.EndpointRouter startApp信息: urn:jxta:jxta-NetGroup "NetPeerGroup"[0] /urn:jxta:jxta-WorldGroup "World PeerGroup"[2] : Router MessageTransport started.2012-7-16 17:32:27 net.jxta.impl.proxy.ProxyServicestartApp信息: JXME Proxy Service started.2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded module : Default Network PeerGroup referenceimplementation (net.jxta.impl.peergroup.ShadowPeerGroup)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupdecRefCount信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT DECCREMENTEDTO: 1 bynet.jxta.peergroup.NetPeerGroupFactory.<init>(NetPeerGroupFactory.java:220)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupgetInterface信息: [urn:jxta:jxta-NetGroup] GROUP REF COUNT INCREMENTED TO: 1bynet.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:412)2012-7-16 17:32:27 net.jxta.impl.protocol.RelayConfigAdv<init>警告: Unhandled Element:net.jxta.impl.document.LiteXMLElement@1301ed8 / isOff =<<nullvalue>>2012-7-16 17:32:27 net.jxta.platform.NetworkManagerstartNetwork信息: Started JXTA Network!2012-7-16 17:32:27 net.jxta.platform.NetworkManagerstopNetwork信息: Stopping JXTA Network!2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupdecRefCount信息: [urn:jxta:jxta-NetGroup] GROUP REF COUNT DECCREMENTED TO:0 bynet.jxta.impl.peergroup.RefCountPeerGroupInterface.stopApp(RefCountPeerGroupInterface.java:140)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupdecRefCount信息: [urn:jxta:jxta-NetGroup] STOPPING UNREFERENCED GROUP2012-7-16 17:32:27 net.jxta.impl.proxy.ProxyServicestopApp信息: JXME Proxy Service stopped.JXTA StartedWaiting for a rendezvousconnectionConnected :trueStopping JXTA2012-7-16 17:32:27 net.jxta.impl.cm.Indexer close信息: Closing Indexer2012-7-16 17:32:27net.jxta.impl.endpoint.router.EndpointRouter stopApp信息: urn:jxta:jxta-NetGroup "NetPeerGroup"[0] /urn:jxta:jxta-WorldGroup "World PeerGroup"[1] : Router MessageTransport stopped.2012-7-16 17:32:27 net.jxta.impl.cm.Indexer close信息: Closing Indexer2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl stopApp信息: Discovery service stopped.2012-7-16 17:32:27net.jxta.impl.rendezvous.RendezVousServiceImpl stopApp信息: Rendezvous Serivce stopped2012-7-16 17:32:27 net.jxta.impl.endpoint.tls.TlsManagerclose信息: Shutting down all connections2012-7-16 17:32:27 net.jxta.impl.endpoint.cbjx.CbJxTransportstopApp信息: CbJxTransport stopped2012-7-16 17:32:27 net.jxta.impl.endpoint.EndpointServiceImplstopApp信息: Endpoint Service stopped.2012-7-16 17:32:27net.jxta.impl.membership.pse.PSEMembershipService stopApp信息: PSE Membmership Service stopped.2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupdecRefCount信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT DECCREMENTEDTO: 0 bynet.jxta.impl.peergroup.GenericPeerGroup.stopApp(GenericPeerGroup.java:1245)2012-7-16 17:32:27 net.jxta.impl.peergroup.GenericPeerGroupdecRefCount信息: [urn:jxta:jxta-WorldGroup] STOPPING UNREFERENCEDGROUP2012-7-16 17:32:27net.jxta.impl.discovery.DiscoveryServiceImpl stopApp信息: Discovery service stopped.2012-7-16 17:32:27net.jxta.impl.rendezvous.RendezVousServiceImpl stopApp信息: Rendezvous Serivce stopped2012-7-16 17:32:27net.jxta.impl.endpoint.tcp.IncomingUnicastServer run信息: Server has been shut down.2012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstopApp信息: Total bytes sent : 02012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstopApp信息: Total Messages sent : 02012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstopApp信息: Total bytes received : 02012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstopApp信息: Total Messages received : 02012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstopApp信息: Total connections accepted : 02012-7-16 17:32:27 net.jxta.impl.endpoint.tcp.TcpTransportstopApp信息: TCP Message Transport shut down.2012-7-16 17:32:27 net.jxta.impl.endpoint.EndpointServiceImplstopApp信息: Endpoint Service stopped.2012-7-16 17:32:27 net.jxta.impl.cm.Indexer close信息: Closing Indexer2012-7-16 17:32:27 net.jxta.impl.cm.Indexer close信息: Closing Indexer2012-7-16 17:32:27 net.jxta.platform.NetworkManagerstopNetwork信息: Stopped JXTA Network!
11. 另一个测试程序:package p2p.jxta.helloworld;
import net.jxta.exception.PeerGroupException;import net.jxta.peergroup.PeerGroup;import net.jxta.peergroup.PeerGroupFactory;
public class HelloWorld_JXTA {
public static void main(String args[]){ System.out.println("StartJXTA...."); HelloWorld_JXTA myapp =new HelloWorld_JXTA(); myapp.startJXTA(); System.exit(0);}public void startJXTA(){ PeerGroup pg =null; try { pg =PeerGroupFactory.newNetPeerGroup(); }catch(PeerGroupException e) { System.out.println("Fatal error:group creation failure"); e.printStackTrace(); System.exit(1); } System.out.println("HelloJXTA!:)"); System.out.println("Groupname = "+pg.getPeerGroupName()); System.out.println("GroupID = "+pg.getPeerGroupID().toString()); System.out.println("Peername = "+pg.getPeerName()); System.out.println("PeerID = "+pg.getPeerID().toString()); System.out.println("PeerBaseClass = "+pg.refTcpProtoSpecID.getBaseClass());}
}
12. 测试运行:任意输入用户名和长度大于8位的密码。

JXTA-P2P开发平台基本API使用 java基本api
Relay seeding URIs:任意填写IP地址,并点击【+】添加。

控制台输出:Start JXTA....2012-7-16 17:33:43 net.jxta.impl.peergroup.NullConfiguratorload警告: Platform Config not found :file:/D:/eclipse/workspace/jxta_helloworld/.jxta/PlatformConfig2012-7-16 17:34:03 net.jxta.impl.membership.pse.PSEUtils<init>信息: Loaded Security Pr oviders into system class loader2012-7-16 17:34:04 net.jxta.impl.loader.RefJxtaLoaderfindModuleImplAdvertisement警告: No class forurn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE0000000C02062012-7-16 17:34:04 net.jxta.peergroup.WorldPeerGroupFactorynewWorldPeerGroup信息: Making a new World Peer Group instance using :net.jxta.impl.peergroup.Platform2012-7-16 17:34:04 net.jxta.impl.cm.SrdiIndex clearSrdi信息: Clearing SRDI for null2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Always Access Service(net.jxta.impl.access.always.AlwaysAccessService)2012-7-16 17:34:04net.jxta.impl.endpoint.tcp.IncomingUnicastServeropenServerSocket信息: Server will accept connections at /0.0.0.0:144192012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theTCP Message Transport(net.jxta.impl.endpoint.tcp.TcpTransport)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRendezvous Service(net.jxta.impl.rendezvous.RendezVousServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of thePeerinfo Service (net.jxta.impl.peer.PeerInfoServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theEndpoint service (net.jxta.impl.endpoint.EndpointServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theHTTP Message Transport(net.jxta.impl.endpoint.servlethttp.ServletHttpTransport)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : None Membership Service(net.jxta.impl.membership.none.NoneMembershipService)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theResolver service (net.jxta.impl.resolver.ResolverServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theDiscovery service(net.jxta.impl.discovery.DiscoveryServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theIP Multicast Message Transport(net.jxta.impl.endpoint.mcast.McastTransport)2012-7-16 17:34:04 net.jxta.impl.endpoint.tcp.TcpTransportstartApp警告: Stalled until there is an endpoint service2012-7-16 17:34:04net.jxta.impl.rendezvous.RendezVousServiceImpl startApp警告: Stalled until there is an endpoint service2012-7-16 17:34:04 net.jxta.impl.peer.PeerInfoServiceImplstartApp警告: Stalled until there is a resolver service2012-7-16 17:34:04 net.jxta.impl.endpoint.EndpointServiceImplstartApp信息: Endpoint Service started.2012-7-16 17:34:04net.jxta.impl.endpoint.servlethttp.HttpMessageSender start信息: HTTP Client Transport started.2012-7-16 17:34:04net.jxta.impl.discovery.DiscoveryServiceImpl startApp警告: Stalled until there is a rendezvous service2012-7-16 17:34:04 net.jxta.impl.endpoint.mcast.McastTransportstartApp信息: IP Multicast Message Transport started.2012-7-16 17:34:04net.jxta.impl.endpoint.tcp.TcpTransport$MessengerSelectorThreadrun信息: MessengerSelectorThread polling started2012-7-16 17:34:04 net.jxta.impl.endpoint.tcp.TcpTransportstartApp信息: TCP Message Transport started.2012-7-16 17:34:04net.jxta.impl.endpoint.tcp.IncomingUnicastServer run信息: Server is ready to accept connections2012-7-16 17:34:04net.jxta.impl.rendezvous.adhoc.AdhocPeerRdvService<init>信息: RendezVous Service is initialized forurn:jxta:jxta-WorldGroup as an ad hoc peer.2012-7-16 17:34:04net.jxta.impl.rendezvous.RendezVousServiceImpl startApp信息: Rendezvous Serivce started2012-7-16 17:34:04net.jxta.impl.discovery.DiscoveryServiceImpl beEdge信息: Switched to a Edge peer role.2012-7-16 17:34:04net.jxta.impl.discovery.DiscoveryServiceImpl startApp信息: Discovery service started2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGroupgetInterface信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT INCREMENTED TO:1 bynet.jxta.peergroup.PeerGroupFactory.newPlatform(PeerGroupFactory.java:425)2012-7-16 17:34:04 net.jxta.peergroup.NetPeerGroupFactorynewNetPeerGroup信息: Instantiating net peer group :urn:jxta:jxta-NetGroupParent : urn:jxta:jxta-WorldGroup "World PeerGroup"[1]ID : urn:jxta:jxta-NetGroupName : NetPeerGroupimpl : null2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGroupgetInterface信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT INCREMENTED TO:2 bynet.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:652)2012-7-16 17:34:04 net.jxta.impl.cm.SrdiIndex clearSrdi信息: Clearing SRDI for null2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRelay Message Transport(net.jxta.impl.endpoint.relay.RelayTransport)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : PSE Membership Service(net.jxta.impl.membership.pse.PSEMembershipService)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of thePipe Service (net.jxta.impl.pipe.PipeServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRouter Message Transport(net.jxta.impl.endpoint.router.EndpointRouter)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Always Access Service(net.jxta.impl.access.always.AlwaysAccessService)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theRendezvous Service(net.jxta.impl.rendezvous.RendezVousServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theEndpoint service (net.jxta.impl.endpoint.EndpointServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of thePeerinfo Service (net.jxta.impl.peer.PeerInfoServiceImpl)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theCryptobased-ID Message Transport(net.jxta.impl.endpoint.cbjx.CbJxTransport)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theResolver service (net.jxta.impl.resolver.ResolverServiceImpl)2012-7-16 17:34:04 net.jxta.impl.endpoint.tls.TlsTransport<init>信息: Adjusting TLS connection idle timeout to 300000millis.2012-7-16 17:34:04 net.jxta.impl.endpoint.tls.TlsTransport<init>信息: Adjusting TLS min reconnection idle to 60000 millis.2012-7-16 17:34:04 net.jxta.impl.endpoint.tls.TlsTransport<init>信息: Adjusting TLS maximum retry queue age to 120000millis.2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theTLS Message Transport(net.jxta.impl.endpoint.tls.TlsTransport)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded privileged module : Reference Implementation of theDiscovery service(net.jxta.impl.discovery.DiscoveryServiceImpl)2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayTransportstartApp警告: Stalled until there is an endpoint service2012-7-16 17:34:04net.jxta.impl.membership.pse.PSEMembershipService startApp信息: PSE Membmership Service started.2012-7-16 17:34:04 net.jxta.impl.pipe.PipeServiceImplstartApp警告: Stalled until there is an endpoint service2012-7-16 17:34:04net.jxta.impl.endpoint.router.EndpointRouter startApp警告: Stalled until there is an endpoint service2012-7-16 17:34:04net.jxta.impl.rendezvous.RendezVousServiceImpl startApp警告: Stalled until there is an endpoint service2012-7-16 17:34:04 net.jxta.impl.endpoint.EndpointServiceImplstartApp信息: Endpoint Service started.2012-7-16 17:34:04 net.jxta.impl.peer.PeerInfoServiceImplstartApp警告: Stalled until there is a resolver service2012-7-16 17:34:04 net.jxta.impl.endpoint.cbjx.CbJxTransportstartApp信息: CbJxTransport started2012-7-16 17:34:04net.jxta.impl.discovery.DiscoveryServiceImpl startApp警告: Stalled until there is a rendezvous service2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayTransportstartApp警告: Stalled until there is a discovery service2012-7-16 17:34:04 net.jxta.impl.pipe.PipeServiceImplstartApp警告: Stalled until there is a rendezvous service2012-7-16 17:34:04net.jxta.impl.endpoint.router.EndpointRouter startApp警告: Endpoint Router start stalled until rendezvous serviceavailable2012-7-16 17:34:04net.jxta.impl.rendezvous.edge.EdgePeerRdvService<init>信息: RendezVous Service is initialized forurn:jxta:jxta-NetGroup as an Edge peer.2012-7-16 17:34:04net.jxta.impl.rendezvous.RendezVousServiceImpl startApp信息: Rendezvous Serivce started2012-7-16 17:34:04net.jxta.impl.discovery.DiscoveryServiceImpl beEdge信息: Switched to a Edge peer role.2012-7-16 17:34:04net.jxta.impl.discovery.DiscoveryServiceImpl startApp信息: Discovery service started2012-7-16 17:34:04net.jxta.impl.rendezvous.edge.EdgePeerRdvService$MonitorTaskrun警告: Rendezvous connection stalled until router isstarted!2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayTransportstartApp警告: Stalled until there is a pipe service2012-7-16 17:34:04 net.jxta.impl.cm.SrdiIndex<init>信息: [urn:jxta:jxta-NetGroup[0] / urn:jxta:jxta-WorldGroup"World PeerGroup"[2]] : Initialized pipeResolverSrdi2012-7-16 17:34:04 net.jxta.impl.cm.SrdiIndex startGC信息: [urn:jxta:jxta-NetGroup[0] / urn:jxta:jxta-WorldGroup"World PeerGroup"[2]] : Starting SRDI GC Thread forpipeResolverSrdi2012-7-16 17:34:04 net.jxta.impl.cm.SrdiIndex<init>信息: [urn:jxta:jxta-NetGroup[0] / urn:jxta:jxta-WorldGroup"World PeerGroup"[2]] : Initialized routerSrdi2012-7-16 17:34:04net.jxta.impl.endpoint.router.EndpointRouter startApp信息: urn:jxta:jxta-NetGroup[0] / urn:jxta:jxta-WorldGroup"World PeerGroup"[2] : Router Message Transport started.2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayClientstartClient信息: Started client :relay://uuid-59616261646162614A7874615032503390C03A49115B41F68165C478286CEE23032012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayClientrun信息: Start relay client thread2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayTransportstartApp信息: Relay Message Transport started2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayClientrun严重: Uncaught Throwable in thread :Relay Client Worker Threadforrelay://uuid-59616261646162614A7874615032503390C03A49115B41F68165C478286CEE2303java.lang.IllegalArgumentException: URI is not absoluteat java.net.URI.toURL(Unknown Source)atnet.jxta.impl.util.URISeedingManager.loadSeeds(URISeedingManager.java:450)atnet.jxta.impl.util.URISeedingManager.refreshActiveSeeds(URISeedingManager.java:360)atnet.jxta.impl.util.URISeedingManager.getActiveSeedRoutes(URISeedingManager.java:283)atnet.jxta.impl.endpoint.relay.RelayClient.run(RelayClient.java:344)at java.lang.Thread.run(Unknown Source)2012-7-16 17:34:04 net.jxta.impl.endpoint.relay.RelayClientrun信息: stop client thread2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGrouploadModule信息: Loaded module : Default Network PeerGroup referenceimplementation (net.jxta.impl.peergroup.ShadowPeerGroup)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGroupgetInterface信息: [urn:jxta:jxta-NetGroup] GROUP REF COUNT INCREMENTED TO: 1bynet.jxta.peergroup.PeerGroupFactory.newNetPeerGroup(PeerGroupFactory.java:501)2012-7-16 17:34:04 net.jxta.impl.peergroup.GenericPeerGroupdecRefCount信息: [urn:jxta:jxta-WorldGroup] GROUP REF COUNT DECCREMENTEDTO: 1 bynet.jxta.peergroup.PeerGroupFactory.newNetPeerGroup(PeerGroupFactory.java:552)Hello JXTA!:)Group name =NetPeerGroupGroup ID =urn:jxta:jxta-NetGroupPeer name = xsjPeer ID =urn:jxta:uuid-59616261646162614A7874615032503390C03A49115B41F68165C478286CEE2303Peer BaseClass =urn:jxta:uuid-DEADBEEFDEAFBABAFEEDBABE0000000905
13. 注意事项:(1)对于编码中用到Unicode中文,可能会报错,需要修改文本文件编码:【窗口】->【首选项】->【常规】->【工作空间】->【文本文件编码】->【点选:其他】->【下拉选择:UTF-8】->【应用】->【确定】
(2)JXTA2.5,在创建一个类似HelloWorld程序的时候,可能出现一个异常,这个异常信息大致是:警告: Failed to find class for urn:jxta:uuid-...java.lang.ClassNotFoundException:...出现这个异常是由于JXTA2.5的jar包引起的,在jxta.jar包的内部有一个bug,需要修正一下,具体解决方法是:jxta.jar包里面的META-INFservicesnet.jxta.platform.Module后面加上一句:urn:jxta:uuid-deadbeefdeafbabafeedbabe0000000C0206net.jxta.impl.shell.ShellApp Reference Implementation ofShell
(3)第二个测试程序运行后将在工程根目录产生.settings文件夹,如果不删除则下次运行时将不会产生上述两个界面,删除后可以看到。
14. 参考资料:[1] http://download.java.net/jxta/[2] http://java.net/projects/jxta

  

爱华网本文地址 » http://www.aihuau.com/a/25101015/276333.html

更多阅读

p2p终结者怎么用的使用方法 p2p终结者用了更加卡

p2p终结者怎么用的使用方法——简介p2p终结者怎么用的使用方法,p2p终结者是一款局域网控制软件,他的主要功能就是控制和限制同一个局域网内其它的上网用户,如限制不让别人上QQ,不让别人开网页和不让别人下载,只要他和你在同一网之内你就

APP制作,APP开发平台,APP教程 微信开发者平台教程

APP制作,APP开发平台,APP教程——简介不懂程序代码也可以制作App,App制作工具软件网站介绍这篇文章我将介绍几个适用于站长的App制作工具,顺便介绍下他们各自的特点。即使不会代码也可以搞定,做出自己的App。APP制作,APP开发平台,APP教程

安卓手机开发平台搭建 mac 安卓开发环境搭建

android手机开发平台搭建www.111cn.net2012-02-09 编辑:jimmy本文章来给想做android手机开的朋友介绍一下android手机开发平台环境配置教程,有需要的同学可以参考一下本教程。初学Android,以便记录学习过程,增强学习效果。1.下载搭建a

声明:《JXTA-P2P开发平台基本API使用 java基本api》为网友檉掱修罗分享!如侵犯到您的合法权益请联系我们删除