title: How to integrate EJB with Spring Beans and dealing with Singleton
body: <p>I had a working project with dependency injection and Singleton in clear Java EE:</p>
  
  <pre><code>@javax.inject.Singleton
  public class SomeSingleton {...}
  </code></pre>
  
  <p>I use it anywhere inside application and I receive the same instance:</p>
  
  <pre><code>@Inject SomeSingleton instanceOfSingleton;
  </code></pre>
  
  <p>Lately I had to add Spring module which uses my <strong><em>SomeSingleton</em></strong> class. Spring needs the instance to be manually produced by @Bean annotation:</p>
  
  <pre><code>@Bean
  public SomeSingleton someSingleton(){
      return new SomeSingleton();
  }
  </code></pre>
  
  <p>The problem is that I have two instances of singleton now. How can I fix this?</p>