Good day. It seems like Tomcat's javaURLContextFactory tries to associate naming context with current thread classloader. But current thread classloader is temporary changed to org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.AggregatedClassLoader during org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build call. AggregatedClassLoader is not related to web-app classloader via parent property.
Considering this comment in org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build:
// IMPL NOTE : TCCL handling here is temporary. // It is needed because this code still uses Hibernate Configuration and Hibernate commons-annotations // in turn which relies on TCCL being set.
issue will be resolved when there would be no need in this TCCL handling.
P.S.: The issue is still actual for version 4.3.2.Final
|