| Hum, even my fix in EntityType.determineAssociatedEntityClass() does not work in some cases as it tries to access the SF before it being available in TypeConfiguration. I end up with:
Caused by: org.hibernate.HibernateException: TypeConfiguration was not yet scoped to SessionFactory
at org.hibernate.type.spi.TypeConfiguration$Scope.getSessionFactory(TypeConfiguration.java:308)
at org.hibernate.type.spi.TypeConfiguration.getSessionFactory(TypeConfiguration.java:185)
at org.hibernate.type.EntityType.determineAssociatedEntityClass(EntityType.java:253)
at org.hibernate.type.EntityType.getReturnedClass(EntityType.java:245)
at org.hibernate.mapping.Array.getElementClass(Array.java:42)
at org.hibernate.mapping.Array.getDefaultCollectionType(Array.java:61)
at org.hibernate.mapping.Collection.getCollectionType(Collection.java:386)
at org.hibernate.mapping.Collection.getType(Collection.java:381)
at org.hibernate.mapping.Property.getType(Property.java:69)
at org.hibernate.event.service.internal.EventListenerRegistryImpl.prepare(EventListenerRegistryImpl.java:158)
at org.hibernate.internal.SessionFactoryImpl.prepareEventListeners(SessionFactoryImpl.java:396)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:206)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
This won't be a simple fix. Steve Ebersole did we get rid of ReflectHelper#classForName() in 6? If not, I think we should think about it and fix the various contracts to have the ClassLoaderService available if we want to have a consistent class loading. |