문제

The situation: one server machine with some installed Application Servers (JBoss). JVM is alone for the whole machine and it's used by every server. Every server has his own RMI stub which is registered in RMI registry while server is starting. But, for correct work of RMI it's needed to define Java property java.rmi.server.codebase = path to jar file with classes for stubing. This is the main problem: when many servers use one JVM, but defined path is to only one application server directory. Thus, RMI clients can't connect to different servers and invoke different versions of remote interfaces.

My view is there're the following ways:

  1. Create separate RMI registry in every application server (in JBoss), but I don't know how it makes?
  2. Add into the name of stub sign of application server (e.g. host:port) and then from client lookup jndi name of needed server+stub?

Are there any other variants? Maybe someone already met with such problem?

도움이 되었습니까?

해결책

(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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top