[hibernate-dev] classloading issue when trying to add envers to as7

Scott Marlow smarlow at redhat.com
Mon Jun 20 13:56:14 EDT 2011


>
> and adding envers into org.hibernate module, means there will no org.hibernate.envers module, and a (jpa) app's classloader can access org.hibernate module, right? so it can access envers class too.

Wrong, just adding envers to org.hibernate (either via a module 
dependency or the jar directly) doesn't result in envers being exported 
from the org.hibernate module.  There is an option to do that, if so 
desired (via the export="true").  The better option is knowing whether 
or not it is needed and dynamically injecting envers only if it is.

 From what you previously said, I think the dependencies are:

- Application classes may reference the envers annotation.

- Application classes may reference Hibernate classes.

- Hibernate core may reference envers.

- Hibernate envers may reference Hibernate core.

Sound right so far?




More information about the hibernate-dev mailing list