Spring - hibernate load *.hbm.xml from classpath resource?

Files located in src/main/resources end up in WEB-INF/classes when using Maven with a project of type war (and the resources directory structure is preserved). So either place your mapping files in src/main/resources/mapping or use the following configuration.

Files located in src/main/resources end up in WEB-INF/classes when using Maven with a project of type war (and the resources directory structure is preserved). So either place your mapping files in src/main/resources/mapping or use the following configuration: SystemUser.hbm. Xml SystemCredential.hbm.

Xml SystemProvince.hbm. Xml hibernate. Dialect=org.hibernate.dialect.

Oracle10gDialect.

This looks quite okay to me. Hence I don't think the problem is the config. I rather think the files simply aren't on the classpath.

How did you start your application? If you're using eclipse, make sure src/main/resources is used as source folder and resources are copied to target/classes.

Yes, I have the default maven's src/main/resources as source folder and my app is a webapp. I've copied these files to web-inf/classes folder but it doesn't work – robinmag Dec 22 '09 at 17:23 When you say 'these files to web-inf/classes', do you mean e.g. Web-inf/classes/SystemUser.hbm. Xml?

If yes, then you should move it to web-inf/classes/mapping/SystemUser.hbm.xml. I don't have any other idea right now. – sfussenegger Dec 22 '09 at 17:39.

In web applications, when you write a resource path without prefix, Spring loads it from a context root (i.e. , from a folder containing WEB-INF). To load resources from a classpath you should use "classpath:" prefix: classpath:mapping/SystemUser.hbm.xml.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions