I am trying to get my war to load up in tomcat but keep getting a listenerStart error. This is because my app uses Spring + Hibernate, and tomcat isn't finding my Hibernate mapping files - I am seeing FileNotFoundException in the tomcat.log. Do I have to add these config files to my classpath? I thought that everything under WEB-INF was added, or is that just classes?
Thank you for that correction Bear. It is now working. I previously had the configuration files in /WEB-INF, not /WEB-INF/classes.
Is it common practice to put everything, such as configuration files, other resources, etc.. under /WEB-INF/classes, or do a lot of people modify the classpath? For example, lets say I wanted my configuration files to be in a folder under / instead of /WEB-INF/classes, or even in a folder outside of the war.
There was a question just like this earlier today.
If the property files (or any other resources) need to be in the classpath (this is not always the case), it is customary to put them into the WEB-INF/classes hierarchy, or to jar them up and put the jar in WEB-INF/lib.
Doing weird class-loader things is not recommended. [ November 11, 2006: Message edited by: Bear Bibeault ]
Is it common practice to put everything, such as configuration files, other resources, etc.. under /WEB-INF/classes,
One very good reason is that servlet containers are not allowed to directly serve anything under /WEB-INF/ - imagine the security holes that would open up if your configuration files could be downloaded by anybody.