Some sort of JNDI lookup is needed. If you are talking about JEE components this can be handled for you via the injection annotations; e.g. @EJB.
Only JEE components. I am now developing the code for one machine using injection @EJB that you mentioned and just wondered if there would be required any code changes if we spread this beans into seperate machines.
If I understeand well we can easili spread every EJB to seperate machine and all we have to do is introduce apprioprate deployment descriptors. Am I right?