javahibernateormrhel7rhel5

Hibernate mapping exception on RHEL 6.7 but the code works file on RHEL6.5


I have two packages which need to be scanned for hibernating mappings.

<property name="mappingLocations">
    <list>
        <value>classpath:com/a/b/c/**/*.hbm.xml</value>
        <value>classpath:com/a/b/d/**/*.hbm.xml</value>
    </list>
</property>

This works fine on RHEL 6.5 but on RHEL 6.7 it throws a MappingException.

Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table abc_table refers to an unmapped class: com.a.b.d.bean.Variable.

The mapping of abc_table is present in com.a.b.c package and Mapping for the class com.a.b.d.bean.Variable is present.
Are there any changes in red hat os regarding loading the hibernate mappings?
Does it have to do anything with classpath?
Please suggest an appropriate approach as I could not find one.
Thanks in Advance!!!


Solution

  • I searched more for resolving the classpath and found this. Changed the code as shown below and it worked.

    <property name="mappingLocations">
    <list>
        <value>classpath*:com/a/b/c/**/*.hbm.xml</value>
        <value>classpath:com/a/b/d/**/*.hbm.xml</value>
    </list>
    

    Thank you Naros for the reply!