Skip to main content

Can not load module : ModuleImpAdvertisement missing URI elem...

4 replies [Last post]
ivarulz
Offline
Joined: 2007-08-17

Hello,

I copied some code from a book, a chat example.

I tried to remove the deprecated stuf, but still I have StdPeerGroupParamAdv.

I tried to run the example but I get the following error:

Aug 22, 2007 6:30:00 PM net.jxta.impl.peergroup.StdPeerGroup loadAllModules
WARNING: Could not load module for class ID : urn:jxta:uuid-88C17904F05848D8BCA3A57FFAAEBFC805
net.jxta.exception.PeerGroupException: Can not load module : ModuleImpAdvertisement missing URI element forurn:jxta:uuid-88C17904F05848D8BCA3A57FFAAEBFC805
at net.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:730)
at net.jxta.impl.peergroup.StdPeerGroup.loadAllModules(StdPeerGroup.java:472)
at net.jxta.impl.peergroup.StdPeerGroup.startApp(StdPeerGroup.java:539)
at net.jxta.impl.peergroup.RefCountPeerGroupInterface.startApp(RefCountPeerGroupInterface.java:119)
at com.cna.jxta.test.chat.JxtaMessenger.createPeerGroup(JxtaMessenger.java:271)
at com.cna.jxta.test.chat.JxtaMessenger.main(JxtaMessenger.java:306)
Aug 22, 2007 6:30:00 PM net.jxta.impl.peergroup.StdPeerGroup loadAllModules
WARNING: Will be missing from peer group : The reference BuddyList application implementation

Any help is appreciated.

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
moonlite
Offline
Joined: 2008-01-24

There is no need for

StdPeerGroupParamAdv

any more

bye

pignatarig
Offline
Joined: 2007-12-07

Thanks for your answer moonlite.

But, if now there's no need for StdPeerGroupParamAdv how do I add the Module Implementation Advertisement of my service to the Module Implementation Advertisement of the group?

Thanks in advance.

moonlite
Offline
Joined: 2008-01-24

Hallo,

that is something I did come along too:

StdPeerGroupParamAdv params = new StdPeerGroupParamAdv(newGroupImpl.getParam());

I did not now how to do this without using the StdPeerGroupParamAdv,
even though it is deprecated.
See the code below, which is based
on some example code from sun microsystems.

But in all other cases I don´t know what that class is good for!

Is it that what you mean?

Example code:

public static ModuleImplAdvertisement build_psegroup_impl_adv(PeerGroup base) {
ModuleImplAdvertisement newGroupImpl;
try {
newGroupImpl = base.getAllPurposePeerGroupImplAdvertisement();
} catch (Exception unlikely) {
// getAllPurposePeerGroupImplAdvertisement() doesn't really throw expections.
newGroupImpl = null;
throw new IllegalStateException("Could not get All Purpose Peer Group Impl Advertisement.");
}
try{
//StartFenster.getSecureModuleSpecId();
newGroupImpl.setModuleSpecID(MODULE_SPEC_ID);
//newGroupImpl.setModuleSpecID((ModuleSpecID)ID.create(URI.create(StartFenster.getSecureModuleSpecId())));

newGroupImpl.setDescription(GROUP_DESC_SECURE);
// FIXME bondolo Use something else to edit the params.
StdPeerGroupParamAdv params = new StdPeerGroupParamAdv(newGroupImpl.getParam());
Map services = params.getServices();
ModuleImplAdvertisement aModuleAdv = (ModuleImplAdvertisement) services.get(PeerGroup.membershipClassID);
services.remove(PeerGroup.membershipClassID);
ModuleImplAdvertisement implAdv = (ModuleImplAdvertisement) AdvertisementFactory.newAdvertisement(ModuleImplAdvertisement.getAdvertisementType());
//implAdv.setModuleSpecID(PSEMembershipService.pseMembershipSpecID);
implAdv.setModuleSpecID(Config_Platform.MEMBERSHIP_SERVICE_PSE.pseMembershipSpecID);
implAdv.setCompat(aModuleAdv.getCompat());
implAdv.setCode(PSEMembershipService.class.getName());
implAdv.setUri(aModuleAdv.getUri());
implAdv.setProvider(aModuleAdv.getProvider());
implAdv.setDescription(GROUP_DESC_SECURE);

// Add our selected membership service to the peer group service as the
// group's default membership service.
services.put(PeerGroup.membershipClassID, implAdv);

// Save the group impl parameters
newGroupImpl.setParam((Element) params.getDocument(MimeMediaType.XMLUTF8));

Config_Platform.MODULE_IMPL_SECURE_ADV = newGroupImpl;

Config_Platform.publishRemoteAdvertisement(newGroupImpl);
}
catch(Exception e){
e.printStackTrace();
newGroupImpl = null;
}

return newGroupImpl;
}

bye

pignatarig
Offline
Joined: 2007-12-07

Hi,

I now that this is a quite old post but I have the same problem trying to add a service to a Peer Group.

First I have the warning that the module corresponding with my classID module could not be load (I don't know why) and then as a consequence (I think) when I try to look for the service the lookup method is not able to find it.

I don't know if there are alternative ways to create a group with a new service, I'm using the one explained in the Brendon Wilson's book.

Thanks in advance.