Skip to main content

[JXSE 2.6] Problems with creating a peergroup

2 replies [Last post]
divak
Offline
Joined: 2010-06-06
Points: 0

Hello,

In my program I'm trying to use latest version JXTA 2.6 RC1. I create peer group, I used the code that I wrote to create and join to a group (I inspired myself with this code: http://forums.java.net/jive/thread.jspa?messageID=399027&#399027):

public static PeerGroup createPeerGroup(PeerGroup parent, String name, String desc)
{

PeerGroup group = null;
try
{
ModuleImplAdvertisement implAdv = parent.getAllPurposePeerGroupImplAdvertisement();

// Build the param section (I know this is deprecated code, but we'll take care of this later).
StdPeerGroupParamAdv paramAdv = new StdPeerGroupParamAdv(implAdv.getParam());

// "Core" Services
paramAdv.addService(PeerGroup.endpointClassID, PeerGroup.refEndpointSpecID);
paramAdv.addService(PeerGroup.resolverClassID, PeerGroup.refResolverSpecID);
//paramAdv.addService(PeerGroup.membershipClassID, NoneMembershipService.noneMembershipSpecID);
paramAdv.addService(PeerGroup.membershipClassID, PeerGroup.refMembershipSpecID);
paramAdv.addService(PeerGroup.accessClassID, PeerGroup.refAccessSpecID);

// "Standard" Services
paramAdv.addService(PeerGroup.discoveryClassID, PeerGroup.refDiscoverySpecID);
paramAdv.addService(PeerGroup.rendezvousClassID, PeerGroup.refRendezvousSpecID);
paramAdv.addService(PeerGroup.pipeClassID, PeerGroup.refPipeSpecID);
paramAdv.addService(PeerGroup.peerinfoClassID, PeerGroup.refPeerinfoSpecID);
paramAdv.addService(PeerGroup.contentClassID, ContentServiceImpl.MODULE_SPEC_ID);

// Pour newParamAdv in -> implAdv
XMLElement paramElement = (XMLElement) paramAdv.getDocument(MimeMediaType.XMLUTF8);

implAdv.setParam(paramElement);

group = parent.newGroup(null, implAdv, name, desc);

} catch (Exception ex)
{
ex.printStackTrace();
}
return group;
}

Everything works fine. Next I stop this group with the method myGroup.stopApp(). When I wants to re-create group I get this exception:

2010-06-06 15:36:39 net.jxta.logging.Logging logCheckedSevere
SEVERE: Line 745 net.jxta.impl.peergroup.GenericPeerGroup.loadModule()
java.lang.IllegalStateException: Group has been shutdown. getInterface() is not available
Line 1397 net.jxta.impl.peergroup.GenericPeerGroup.getInterface()
Line 737 net.jxta.impl.peergroup.GenericPeerGroup.loadModule()
Line 1521 net.jxta.impl.peergroup.GenericPeerGroup.newGroup()
Line 111 intercomputer.server.group.PeerGroupManager.createPeerGroup()
Line 68 intercomputer.server.group.PGContainer.()
Line 143 intercomputer.server.gui.CreateGroupGUI$8.actionPerformed()
Line -1 javax.swing.AbstractButton.fireActionPerformed()
Line -1 javax.swing.AbstractButton$Handler.actionPerformed()
Line -1 javax.swing.DefaultButtonModel.fireActionPerformed()
Line -1 javax.swing.DefaultButtonModel.setPressed()
Line -1 javax.swing.plaf.basic.BasicButtonListener.mouseReleased()
Line -1 java.awt.Component.processMouseEvent()
Line -1 javax.swing.JComponent.processMouseEvent()
Line -1 java.awt.Component.processEvent()
Line -1 java.awt.Container.processEvent()
Line -1 java.awt.Component.dispatchEventImpl()
Line -1 java.awt.Container.dispatchEventImpl()
Line -1 java.awt.Component.dispatchEvent()
Line -1 java.awt.LightweightDispatcher.retargetMouseEvent()
Line -1 java.awt.LightweightDispatcher.processMouseEvent()
Line -1 java.awt.LightweightDispatcher.dispatchEvent()
Line -1 java.awt.Container.dispatchEventImpl()
Line -1 java.awt.Window.dispatchEventImpl()
Line -1 java.awt.Component.dispatchEvent()
Line -1 java.awt.EventQueue.dispatchEvent()
Line -1 java.awt.EventDispatchThread.pumpOneEventForFilters()
Line -1 java.awt.EventDispatchThread.pumpEventsForFilter()
Line -1 java.awt.EventDispatchThread.pumpEventsForHierarchy()
Line -1 java.awt.EventDispatchThread.pumpEvents()
Line -1 java.awt.EventDispatchThread.pumpEvents()
Line -1 java.awt.EventDispatchThread.run()

2010-06-06 15:36:39 net.jxta.logging.Logging logCheckedSevere
SEVERE: Line 1525 net.jxta.impl.peergroup.GenericPeerGroup.newGroup()
Could not load group implementation
net.jxta.exception.PeerGroupException: Could not load module for : null (General Purpose Peer Group Implementation)
Line 752 net.jxta.impl.peergroup.GenericPeerGroup.loadModule()
Line 1521 net.jxta.impl.peergroup.GenericPeerGroup.newGroup()
Line 111 intercomputer.server.group.PeerGroupManager.createPeerGroup()
Line 68 intercomputer.server.group.PGContainer.()
Line 143 intercomputer.server.gui.CreateGroupGUI$8.actionPerformed()
Line -1 javax.swing.AbstractButton.fireActionPerformed()
Line -1 javax.swing.AbstractButton$Handler.actionPerformed()
Line -1 javax.swing.DefaultButtonModel.fireActionPerformed()
Line -1 javax.swing.DefaultButtonModel.setPressed()
Line -1 javax.swing.plaf.basic.BasicButtonListener.mouseReleased()
Line -1 java.awt.Component.processMouseEvent()
Line -1 javax.swing.JComponent.processMouseEvent()
Line -1 java.awt.Component.processEvent()
Line -1 java.awt.Container.processEvent()
Line -1 java.awt.Component.dispatchEventImpl()
Line -1 java.awt.Container.dispatchEventImpl()
Line -1 java.awt.Component.dispatchEvent()
Line -1 java.awt.LightweightDispatcher.retargetMouseEvent()
Line -1 java.awt.LightweightDispatcher.processMouseEvent()
Line -1 java.awt.LightweightDispatcher.dispatchEvent()
Line -1 java.awt.Container.dispatchEventImpl()
Line -1 java.awt.Window.dispatchEventImpl()
Line -1 java.awt.Component.dispatchEvent()
Line -1 java.awt.EventQueue.dispatchEvent()
Line -1 java.awt.EventDispatchThread.pumpOneEventForFilters()
Line -1 java.awt.EventDispatchThread.pumpEventsForFilter()
Line -1 java.awt.EventDispatchThread.pumpEventsForHierarchy()
Line -1 java.awt.EventDispatchThread.pumpEvents()
Line -1 java.awt.EventDispatchThread.pumpEvents()
Line -1 java.awt.EventDispatchThread.run()

net.jxta.exception.PeerGroupException: Could not load group implementation
at net.jxta.impl.peergroup.GenericPeerGroup.newGroup(GenericPeerGroup.java:1526)
at intercomputer.server.group.PeerGroupManager.createPeerGroup(PeerGroupManager.java:111)
at intercomputer.server.group.PGContainer.(PGContainer.java:68)
at intercomputer.server.gui.CreateGroupGUI$8.actionPerformed(CreateGroupGUI.java:143)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: net.jxta.exception.PeerGroupException: Could not load module for : null (General Purpose Peer Group Implementation)
at net.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:752)
at net.jxta.impl.peergroup.GenericPeerGroup.newGroup(GenericPeerGroup.java:1521)
... 28 more
Caused by: java.lang.IllegalStateException: Group has been shutdown. getInterface() is not available
at net.jxta.impl.peergroup.GenericPeerGroup.getInterface(GenericPeerGroup.java:1397)
at net.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:737)
... 29 more

With JXSE 2.5 it works with no problems

Thanks,
divak

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
adamman71
Offline
Joined: 2007-01-31
Points: 0

Created an incident at https://jxta-jxse.dev.java.net/issues/show_bug.cgi?id=381.

I already have a patch that solves the problem. Will release it in RC 2.

divak
Offline
Joined: 2010-06-06
Points: 0

Thanks for reply, I will be waiting for RC 2