質問

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