HCANN AnnotationFactory still using TCCL
Description
is fixed by
Activity
Steve EbersoleMay 28, 2015 at 10:27 PM
Resolved by and

Scott MarlowMay 28, 2015 at 12:01 AM
Regarding WildFly and the composite classloader change that you mentioned on IRC. In WildFly, the composite classloader is the application classloader, which has the same javax.persistence classloader as Hibernate ORM is using. So, that should also work, just a more complicated change.

Scott MarlowMay 27, 2015 at 11:56 PM
One other thought, if there are non-ORM callers into AnnotationFactory.create(AnnotationDescriptor descriptor), when they sync up with the new HCANN version that contains the https://gist.github.com/sebersole/64be856cfddd54c4eb76 change, they could be surprised by the change. It is probably a good change, just one that should be communicated on hibernate-dev ml, so others know to expect it. IMO

Scott MarlowMay 27, 2015 at 11:53 PM
I'm not sure about all of the callers but some of the calls that I see are passing in javax.persistence classes (e.g. EntityListeners.class, AssociationOverride.class). https://gist.github.com/sebersole/64be856cfddd54c4eb76 looks fine to me but I'm not familar with the possible callers into AnnotationFactory.create(AnnotationDescriptor descriptor).
I suppose that Hibernate 4.3.x was working because the TCCL was set differently.
Steve EbersoleMay 27, 2015 at 10:59 PM
Thoughts?
Specifically HCANN is trying to use the TCCL in AnnotationFactory for creating the annotation proxy classes. This clearly seems wrong, but I am not sure of the proper solution. I can see one of 2 solutions:
Use the annotation Class's loader
Use the ClassLoaderService's aggregated class loader (which would require a new ClassLoaderService method to create a proxy).