This is the ManagedBean
@ManagedBean @ViewScoped public class DetailItem {
private static final long serialVersionUID = -7647929779133437125L;
@ManagedProperty(value = "#{itemServiceImpl}")
private ItemService servItem;
This is the Service
@Service("itemServiceImpl") @Transactional(value = "transactionManagerLocal") public class ItemServiceImpl implements ItemService {
private static final long serialVersionUID = 1L;
@Autowired
@Qualifier("itemDaoImpl")
private ItemDAO dao;
but when I try to access to the page that used 'DetailItem', I have the following exception:
java.io.NotSerializableException: org.springframework.dao.support.PersistenceExceptionTranslationInterceptor java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
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?
I don´t have the exception with sessionscoped or requestscoped.