Skip to main content

How to initialize PSE in jxse 2.7?

5 replies [Last post]
Joined: 2009-11-22

Does anybody know how to initialize PSE in 2.7? If I start a rdv peer without peerId or infrastructureID then an edge peer can connect to it. As soon as I set any of IDs I'm getting the following message on the edge peer
SEVERE: EndpointRouterMsg declared src address does not match the sender's address.
tempMsgERM.getSrcAddress()=jxta://uuid-59616261646162614A78746150325033246734A29C11461D9CC3BB9B20842C1E03, tempEASuposedToBe=jxta://cbid-59616261646162614A78746150325033426F9328E59F083D855D65F748B6F87E03

It looks to me that it wants the peerId to be generated based on a certificate that jxse automatically generated for the WorldGroup. But if I want the peerId to be always the same it seems that I need to generate all artifacts for PSE myself.
How to properly initialize PSE in 2.7? I mean how it supposed to be initialized? Examples provided with jxse 2.7 were not working for me till I commented peerId out. I think there is some way designers of jxse 2.7 intended PSE to be used.

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-06-18

Sounds like you are deleting the keystore each time you do a restart - if 2.7 discovers that the keystore has gone then it creates a new one and generates a new certificate. Don't forget to save and restore the configuration and it helps to delete the cache.

Joined: 2009-11-22

Can you explain me how to save it?
I tried;

but it causes exception in
PeerGroup NetPeerGroup = MyNetworkManager.startNetwork();

May 24, 2011 8:40:57 AM net.jxta.impl.peergroup.StdPeerGroup initFirst
SEVERE: Failed to make PSE membership credential 'ready for join'
May 24, 2011 8:40:57 AM net.jxta.peergroup.WorldPeerGroupFactory newWorldPeerGroup
SEVERE: World Peer Group could not be instantiated.

net.jxta.exception.PeerGroupException: Failed to login to this group: null. Error=0
at net.jxta.impl.peergroup.StdPeerGroup.initFirst(
at net.jxta.impl.peergroup.Platform.initFirst(
at net.jxta.impl.peergroup.GenericPeerGroup.init(
at net.jxta.peergroup.WorldPeerGroupFactory.newWorldPeerGroup(
at net.jxta.peergroup.WorldPeerGroupFactory.<init>(
at net.jxta.peergroup.NetPeerGroupFactory.<init>(
at net.jxta.platform.NetworkManager.startNetwork(
at Examples.K_Service.Edge_Jill_The_Customer.main(
Edge Jill, The Customer net.jxta.exception.PeerGroupException: World Peer Group could not be instantiated.

Thank you

Joined: 2005-06-18

1. Delete your jxta run dir/folder
2. Create a new jxta configuration, including peer name, peerid if you need to, username, password and all of your network setup
3. Save the configuration file - this usually defaults to PlatformConfig in the jxta run dir
4. Set up the path to the keystore - there is a default
5. Start jxta.
6. Stop jxta, turn off the machine and have a cup of coffee
7. You might want to delete the cache files/dirs in the jxta run dir. Don't delete the keystore!
8. Load the configuration - you shouldn't need to set anything except for the username and password - these are for the keystore - everything else should be in the config file.
9. Set the keystore path if you need to ... must be the one defined above
9 Start jxta.
Read through the source of NetworkManager and NetworkConfigurtor. Believe me, it works!

Joined: 2012-08-06

I've got the same problem i.e. as soon as I set the peerID my code breaks with:

Aug 6, 2012 4:48:53 PM net.jxta.impl.endpoint.WireFormatMessageBinary$Instantiator enforceCbjxOnIncoming
SEVERE: EndpointRouterMsg declared src address does not match the sender's address. tempMsgERM.getSrcAddress()=jxta://cbid-59616261646162614E504720503250331884408F6046A2521650BBCBACD41AB303, tempEASuposedToBe=jxta://cbid-59616261646162614A787461503250335BBE5BCADE2ABB3297475FFEBE0F860903

I've followed your instructions above and modified the practicaljxta2 ( examples Examples.B_Exploring_Connectivity_Issues.RendezVous_Jack and Examples.B_Exploring_Connectivity_Issues.Endge_Anna to reflect this but I cannot get 2.7 to work without commenting out the setPeerId (MyNetworkConfigurator.setPeerID(PID)) and removing the call. Unfortunately in my application I must set the peerID so this is not a solution for me.

Any advice / pointers appreciated as I'm not sure what to try next.


Joined: 2012-08-06

ok I think I have solved it.. I used to call NetworkConfigurator.setPeerId but changing this to NetworkManager.setPeerId fixes the problem. I'm new to jxta so not quite sure what the difference is...