title: spring dependency injection using RMI
body: <p>suppose we have 2 projects ProjectA(front end) and ProjectB(back end) and 2 classes ClassA in ProjectA and ClassB in ProjectB.
  Now I need to get the instance of ClassB in ClassA. 
  The question is how to organize injection of ClassB into ClassA by using Spring and RMI? What to add into spring.xml?
  I'm new in java so  if you can provide the answer with exampls please.
  Thanks in advance!!</p>
  
  <pre><code>public void initializeManager() {
    InitialContext context = null;
    if (manager == null) {
      try {
        Properties props = TaxFormsConfiguration.getInstance().getProperties();
        context = new InitialContext(props);
        manager = (EFormsManager) context.lookup("taxsystem/EFormsManagerFacade/remote");
        if (manager == null) {
          throw new RuntimeException("EFormsManager is null.");
        }
      } catch (Exception e) {
        logger.error("error in EFormsActionManager.initializeManager: " + e.getMessage());
      }
    }
  }
  </code></pre>