Hello!
I got a really important problem and i can't find a solution yet.
Is there a way to get a RMI service running inside a porlet?
Before initiating the rmi binding inside the portlet I started
an rmiregistry on port 1100.
This is the code inside the portlet
public void init(PortletConfig portletConfig) throws PortletException {
PlayableGamesContainer playableGamesContainer = new PlayableGamesContainer();
portletConfig.getPortletContext().setAttribute("playableGamesContainer", playableGamesContainer);
try {
IPortalService bridge = new PortalServiceImpl(playableGamesContainer);
Naming.rebind("rmi://127.0.0.1:1100/PortalService", bridge);
} catch (Exception e) {
throw new PortletException(e);
}
super.init(portletConfig);
}
public TestClient() throws MalformedURLException, RemoteException,
NotBoundException {
//UnicastRemoteObject.exportObject(this);
System.setProperty("java.security.policy", "client.policy");
System.setSecurityManager(new java.rmi.RMISecurityManager());
IPortalService bridge = (IPortalService) Naming
.lookup("rmi://127.0.0.1:1100/PortalService");
IPortalContext game = bridge.registerGame(new GameConfigurationImpl());
game.setMatchListener(this);
}