title: NotSerializableException in a ManagedBean with ViewScoped and Spring's services
body: <p>This is the ManagedBean</p>
  
  <pre><code>@ManagedBean @ViewScoped public class DetailItem {
      private static final long serialVersionUID = -7647929779133437125L;
      @ManagedProperty(value = "#{itemServiceImpl}")
      private ItemService servItem;
  </code></pre>
  
  <p>This is the Service</p>
  
  <pre><code>@Service("itemServiceImpl") @Transactional(value = "transactionManagerLocal") public class ItemServiceImpl implements ItemService {
      private static final long serialVersionUID = 1L;
      @Autowired
      @Qualifier("itemDaoImpl")
      private ItemDAO dao;
  </code></pre>
  
  <p>but when I try to access to the page that used 'DetailItem', I have the following exception:</p>
  
  <pre><code>java.io.NotSerializableException: org.springframework.dao.support.PersistenceExceptionTranslationInterceptor    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)   java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
  </code></pre>
  
  <p>To fix that I do the servItem transient and obtain it from the applicationContext. But I understand that it is not the correct solution and I dont find any other. Which is the proper way to do that?</p>
  
  <p>I don´t have the exception with sessionscoped or requestscoped.</p>