I have an application with Spring framework, using AnnotationSessionFactoryBean. I'm also using Hibernate.
The problem is boReporte is not being instantiated by Spring. If before the problem line I add this:
the application continues to run and the DAO class is instantiated normally in my BO. I don't understand why this happens. I also don't understand why I have to set hibernate's session factory via code, I wasn't able to do it via my applicationContext.xml, which contains the sessionFactory mentioned in the code above.
Well, I had an error in my application. I was instantiating ReporteService with new(), that's why BO was null. If I remove it the application still doesn't run, I get a NullPointerException in my getReporteService method in my pageBean. Again, if I try to use it works. The main problem is, why do I have to use the context to instantiate my beans, at some moment? Wasn't it supposed to be Spring's task?