Re: getMembershipService() returns null

"Mike [bondolo] Duigou" <[email protected]> Thu, 21 Dec 2006 17:31:57 -0800
Newsgroups gmane.comp.java.jxta.user
Organization Project JXTA, http://www.jxta.org
Message-ID <[email protected]>
This is indeed a strange problem. I looked and couldn't figure out a way 
that a peer group could be started without having a membership service 
of some sort or other.

Turning up the log4j level to debug and watching the output of the group 
being started may provide some clues.

Mike

Daniel Evers wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> I have a (very basic) problem that I don't understand:
> I have a peer A running JXTA for J2SE that creates and publishes a new
> peer group, without any authentication or else. This looks like this:
> 
> ModuleImplAdvertisement groupAdv =
> netPeerGroup.getAllPurposePeerGroupAdvertisement();
> PeerGroupID groupID = IDFactory.netPeerGroupID();
> PeerGroup newgroup = netPeerGroup.newGroup(groupID, groupAdv, name,
> 	descr);
> netPeerGroup.getDiscoveryService().remotePublish(newgroup);
> // ... adding module class adv and spec adv ...
> 
> Then I have a peer B running JXTA for JXME/J2ME. This peer discovers the
> new group (no problem here) and tries to join it, like this:
> 
> AuthenticationCredential cred = new AuthenticationCredential(newgroup,
> 				null, null);
> MembershipService membership = newgroup.getMembershipService();
> Authenticator auth = membership.apply(cred);
> if (auth.isReadyForJoin()) {
> 	membership.join(auth);
> } else {
> 	// error handling
> }
> 
> (the peer group "newgroup" here is created from the group adv)
> 
> The problem is, that newgroup.getMembershipService() returns null, and
> as far as I understand, that should never be the case.
> Has anybody got an idea what's going wrong? This worked without problems
> before (changed some things in the meantime, but removed those changes
> again).
> 
> Thanks!
> Daniel
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFFikJMBHvLeozhC4kRAsrSAKCXLoQwHukmputEe7TyhwZNVUhIdQCeP/ao
> j3XfDoM73mqYhS5ysQ0G3H4=
> =8Zef
> -----END PGP SIGNATURE-----