[hibernate-dev] HCANN, AnnotationFactory and TCCL
sanne at hibernate.org
Thu May 28 06:08:05 EDT 2015
On 28 May 2015 at 05:34, Steve Ebersole <steve at hibernate.org> wrote:
> WildFly consuming ORM 5.0 is still hitting one last TCCL issue with HCANN.
> It happens in
> the org.hibernate.annotations.common.annotationfactory.AnnotationFactory#create
> method trying to build the "annotation proxy class".
> There are a few possible approaches to resolve this...
> The simplest potentially effects other HCANN consumers, so we'd obviously
> all need to agree. Anyway, the simplest approach is to use the ClassLoader
> for annotation @interface Class rather than the TCCL. I do not see a
> problem with that, but it would change some semantic.
+1 as well
With that TCCL trick in place it seems it was possible to have the
module actually use a set of annotations provided by the user, to
override those (with same name) already provided by ORM. If that was
meant as a "feature" I'd be glad to see it killed.
> The only other workable approach (without redesign of HCANN) I could think
> of is to basically make a copy of AnnotationFactory and copy it into ORM.
> Sure I could overload AnnotationFactory#create to optionally accept a
> ClassLoader, but that introduces a hard dependency on new specific version
> of HCANN.
The above approach seems nicer as you already have the Class,
otherwise I'd prefer to see such helpers to always allow an explicit
I don't think you have to worry about ORM requiring new versions of
HCANN occasionally, we all have to make changes to keep up anyway and
a version upgrade is easy enough.
We did have a problem with recent "planet alignment" efforts of
versions on other platforms though, which was caused by a significant
semantic change of a similar classloader improvement, and some people
had upgraded the micro version of HCANN without enough testing. As far
as I remember the dangerous upgrade was the upgrade from HCANN
4.0.1.Final to 4.0.5.Final, which breaks Hibernate ORM 4.2 within the
In retrospective we should have increased the minor version of HCANN,
so maybe you could do that now when fixing the TCCL issue?
> Open to other suggestions. Thoughts?
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
More information about the hibernate-dev