I have a Eclipse Dynamic Web Project which host a simple servlet and runs on Tomcat. I use Hibernate within - I have classes that map to database tables and hbm.xml files for them within my project. Everything works fine - I can use Hibernate from Servlet and modify database tables through classes. But now I want to move my "model" (Java classes for SQL tables and mapping files) to a separate Eclipse project so that I can use this "model" from other projects. After I specify a reference from my Web project to the "model" project, Eclipse can see the references and allows me using classes, but when I deploy and run the project on Tomcat, there are always errors like:
org.hibernate.MappingNotFoundException: resource: xxx/yyy/zzz/model/MyClassTable.hbm.xml not found
I suspect this is because I have to put classes for the model into WEB-INF directory, but I have no other idea how to do it than doing it manually. What is the correct way to configure Web Project in that case?