Antonio Correia wrote:Yes this null.
Where do I have to initialize the spring or class?
I am not sure I haven't been using Spring for a while but Spring should normally initialize it for you. You shouldn't have to create the sessionFactory yourself when using Spring. It is just a matter of getting it from Spring the right way.
Search Google for "getting hibernate session factory from Spring".
I found many links covering the subject and it seems like there is a few ways to do it.
Since you use this :LocalSessionFactoryBean:
Search for documentation specific on that but I recommend to let Spring manage the retreival and creation of the SessionFactory.
"getting hibernate session factory from Spring when using LocalSessionFactoryBean".
From your other classes imports, i see, that you package name is Classhiber, here you give classhiber, it is case sensitive, its a best practice to have package names in small letters, so change your package names accordingly.