<div dir="ltr"><div>Have you considered a 3rd alternative, which is to use a custom ProxyFactory instead of javassists built in one?<br><br></div><div>AFAIK the main issue is that javassist proxies require access to the &#39;javassist.util.proxy.MethodHandler|RuntimeSupport&#39; classes. You could create a similar org.hibernate interface, and a proxy factory that uses this method handler instead. <br></div><div><br></div><div>Basically you just copy the code from javassist.util.proxy into hibernate. This is a relatively small amount of code, so it should not really add any maintenance burden.<br></div><div><br></div><div>The inability to change javassist versions could be a major pain for Hibernate later on, as it may mean that older hibernate versions fail to work with newer JDK&#39;s if changes are made to the class file format.<br></div><div><br></div>Stuart<br><div><div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, 12 Feb 2016 at 03:03 Scott Marlow &lt;<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As previously discussed, Hibernate applications need access to the<br>
Javassist runtime classes (see example [1] enhanced application entity<br>
if you didn&#39;t know this :).  A proposal was discussed on the<br>
hibernate-dev mailing list that I think is the best short term solution.<br>
  I wanted to raise this issue here also, as I would like to later<br>
create a pull request to bring in a new Hibernate ORM that includes this<br>
change.  So, getting early feedback before we create JIRAs for the work,<br>
is important.<br>
<br>
The proposal is to private package (or shade), the Javassist classes, so<br>
that Hibernate ORM has its own copy of the Javassist classes.  On<br>
WildFly, we still would include Javassist for the other components that<br>
use it and for Hibernate applications that have &quot;build-time enhanced<br>
entity classes&quot; by an earlier Hibernate release.<br>
<br>
One downside of this change is that Hibernate applications cannot easily<br>
switch to a different version of the Javassist classes.<br>
<br>
Another downside is that applications that depend on an older Hibernate<br>
ORM version that includes &quot;build-time enhanced entity classes&quot;, will<br>
need to be cracked open, to add dependencies on the Javassist module<br>
(since we will stop automatically adding Javassist to JPA application<br>
deployments).<br>
<br>
The advantage of this change, is that Hibernate applications can include<br>
their own version of Javassist.<br>
<br>
This will also have an impact on Hibernate build-time enhancing of<br>
entity classes (e.g. enhanced bytecode will no longer depend on the<br>
public Javassist classes).<br>
<br>
Scott<br>
<br>
[1] <a href="https://gist.github.com/scottmarlow/dc7ebfea654984f84e2e" rel="noreferrer" target="_blank">https://gist.github.com/scottmarlow/dc7ebfea654984f84e2e</a><br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</blockquote></div></div></div></div></div>