We're updating the issue view to help you get more done. 

HbmMetadataSourceProcessor issue when combining annotation and hbm.

Description

After upgrading wildfly from 9.0.2 to 10.0.0.Final, we are experiencing issue with Hibernate MetadatasourceProcessor. Its throwing the following exception when one Entity is annotated with jpa and another entity extends it with hbm mapping.

1 2 3 Caused by: org.hibernate.HibernateException: Not all named super-types (extends) were found : [com.sample.model.Sample] at org.hibernate.boot.model.source.internal.hbm.EntityHierarchyBuilder.buildHierarchies(EntityHierarchyBuilder.java:76) at org.hibernate.boot.model.source.internal.hbm.HbmMetadataSourceProcessorImpl.<init>(HbmMetadataSourceProcessorImpl.java:66)

The hierarchy of entity as follows

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 @Entity @Table(name = "tbl_sample") public class Sample extends Auditable { private Long id; @ManyToOne @JoinColumn(name = "relationA", nullable = true) private RelationA relationA; ... etc } @MappedSuperClass public abstract class Auditable extends Persistable { //audit props } @MappedSuperClass public abstract class Persistable { //common props } public class BloodSample extends Sample { ..... } BloodSample.hbm.xml <hibernate-mapping package="com.sample.model.impl"> <joined-subclass name="BloodSample" table="tbl_blood_sample" extends="com.sample.model.Sample"> <key column="ID" /> <property name="sampleNo" column="sampleNo"/> etc.... </joined-subclass> </hibernate-mapping>

When i turned on trace log the above exception is coming after the below debug log

1 DEBUG [org.hibernate.boot.model.source.internal.hbm.EntityHierarchyBuilder] (ServerService Thread Pool -- 64) Entity super-type named as extends [com.sample.model.Sample] for subclass [Origin(name=vfs:/home/nick/servers/wildfly-10.0.0.Final/standalone/deployments/sample-ear.ear/lib/sample.jar/com/sample/model/impl/BloodSample.hbm.xml,type=INPUT_STREAM):com.sample.model.impl.BloodSample] not found

Full discussion can be found here : https://developer.jboss.org/message/952546
and here http://stackoverflow.com/questions/35910271/spring-could-not-create-entitymanagerfactory-after-upgrading-to-hibernate-5-x

Environment

Wildfly.10.0.0.Final, Postgres

Status

Assignee

Unassigned

Reporter

nick

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.0.Final
5.1.1
5.2.4
5.0.10

Priority

Blocker