[jboss-user] [JBoss Portal] - JBoss Portal and RMI

smoothny do-not-reply at jboss.com
Fri Feb 1 02:59:15 EST 2008


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);
  | 	}
  | 

This is the client I'm trying to connect with



  | 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);
  | 	}
  | 

What I get is an access denied error from the server. If I setup
a new SecurityManager inside the portlet I don't get this error,
but it seems the a new security manager overwrites a jboss internal
one. Cause I get lots of access denied errors for the jboss internal
methods in the console. Any suggestions? Is there a way to get
RMI working?

Kind regards
Sascha

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125393#4125393

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125393



More information about the jboss-user mailing list