We tried configuring the LocalSessionFactoryBean to locate the hibernate mapping files in a jar or directory. Neither seems to work. We get the error:
java.io.FileNotFoundException: class path resource [classpath*:hibernate-mapping] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getU RL(ClassPathResource.java:147)
at org.springframework.core.io.ClassPathResource.getF ile(ClassPathResource.java:154)
at org.springframework.orm.hibernate.LocalSessionFact oryBean.afterPropertiesSet(LocalSessionFactoryBean .java:463)
Here's how we tried to configure the sessionfactory:
<property name="mappingJarLocations">
<list>
<value>classpath:hibernate-mappings.jar</value>
</list>
</property>
where hibernate-mappings.jar was in the root of the ear
and we tried:
<property name="mappingDirectoryLocations">
<list>
<value>classpath*:hibernate-mapping</value>
</list>
</property>
where the directory was in the root directory of the ear.
Neither works. I saw in your posting that you got it to work with the directory on the file system. Am I doing something wrong? We also tried giving the absolute path of the directory and jar - that didn't work either.


Reply With Quote
):