(1) is your only choice. It is done with LocateRegistry.createRegistry()
, unless JBoss has a way to configure it permanently. You will have to use separate ports per Registry.
(2) doesn't even make sense to me without further explanation, unless it is really a continuation of (1).