0 Replies Latest reply: Aug 27, 2010 3:59 AM by Egidijus Vaisnora RSS

Who should know how to locate server?

Egidijus Vaisnora Newbie

I recently stuck with server configuration (behind NAT) issue (http://http://community.jboss.org/message/559084#559084). I needed to configure RMI to replace server address in stub, then I needed to change JBoss remoting server locator parameters for EJB 3 to use remote IP. If I use JMS, I would need to change something more I guess... And all configuration I need to make on server side. But the fact is, that server doesn't know by which address it will be connected and by which address it is accessible for client. If I have server running behind NAT and it is supposed to be accessible from the remote and local network. Then I, probably, will have problems because local network could be configured to not see remote address, but java.rmi.server.hostname property allows to specify only one address. Which one to use - local or remote?

With JBoss remoting it is better - you can define on server configuration many addresses which client should check if it can access. But does realy server should care about client task how to locate properly itself (server)?

 

In fact, client knows how to access server. For example, my code makes lookup for EJB and I am passing server address, which I know, I should be able to access. Hence I cannot understand, why, for example, code which receives RMI stubs from server cannot inline server address (which was used to acces it on lookup by client) into stub ? Or why not to have JBoss remoting code on client side, which will make socket opening to the address I used to connect to server (let say by lookup), instead of getting list of addresses from server and trying each in the list for accessibility.

 

Advantage - simple configuration. Actually there are no configuration, bacause that client uses everythere address which was entered by user.