[wildfly-dev] Could WildFly automatically detect Hibernate native applications and auto add Hibernate dependencies to the application classpath...

Scott Marlow smarlow at redhat.com
Tue Mar 28 12:32:40 EDT 2017


Hibernate native applications that are deployed on WildFly, need the 
application classpath to include org.hibernate:main + org.javassist:main 
static modules.  We proposed via WFLY-459 [1], that the Hibernate ORM 
module should export the javassist module but that is not overrideable 
by applications (since module exclusions are ignored for export=true 
modules).

Another approach could be adding a (tattletale like?) deployment unit 
processor to WildFly, that could scan through application classes, 
without loading them, to check for references to certain Hibernate 
classes, like "org.hibernate.Session".  Would that introduce too much 
overhead to deployment?  If we did this scanning, we would have to scan 
through all application classes to verify that the application doesn't 
already depend on a Hibernate static module or include its own copy of 
Hibernate classes.

Perhaps an alternative could be a wildflySomething.xml way to indicate 
that a deployment is a Hibernate native application and that 
Hibernate/Javassist dependencies should be auto added.

What do you think?

Scott

[1] https://issues.jboss.org/browse/WFLY-459





More information about the wildfly-dev mailing list