0 Replies Latest reply on Feb 1, 2008 2:59 AM by Sascha Smutny

    JBoss Portal and RMI

    Sascha Smutny Newbie

      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