title: How to re-inject a transient @ManagedProperty at deserializing?
body: <p>I'm using Spring and JSF 2 to create a web application.
  The business objects are kept in the Spring container, and I inject them in the Managed Beans using the @ManagedProperty, like this:</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class SomeMB implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Getter @Setter
      @ManagedProperty("#{someService}")
      private SomeService someService;
      // ...
  </code></pre>
  
  <p>The problem is, I keep getting a <code>NotSerializableException</code> for a class from Spring (<em>ServiceLocatorFactoryBean</em>) that it's being used by the <em>SomeService</em> bean.</p>
  
  <p>If I make it <code>transient</code>, how could I do the re-injection of it after deserializing?</p>
  
  <p>Or, what would be other ways to solve this problem?</p>
  
  <p>I've been reading several other questions similar here, but couldn't find any that dealt exactly with this problem.</p>