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.
Do you need to add the bean names to the Annotations?
Did you check to see what exceptions were thrown, in the logs?
For the Hibernate stuff, why are you using "Annotated Packages" They are not used to find Entities. Most people think that that property is for that, but it isn't.
But for your issue, i know there had to be an exception thrown and we need to see what that it, that will tell us why Spring either missed the class, or had a problem with something.
So it might be in your Tomcat console or Tomcat log.
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?