-
15. Re: Trying to use Envers with AS-provided Hibernate
nickarls Aug 2, 2011 9:07 AM (in response to adamw)Anyway, I ripped it out manually and got a CNFE for dom4j, then tried adding it as a manifest Dependency: and got back to the classcastexception :-/
-
16. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 2, 2011 9:11 AM (in response to nickarls)So you reproduced my problem
Adam -
17. Re: Trying to use Envers with AS-provided Hibernate
smarlow Aug 2, 2011 10:40 AM (in response to jaikiran)Strong told me that Envers has a dependency on Hibernate and Hibernate has a dependency on Envers. Strong will take another look at integrating Envers this week and update us on his progress.
Rather than having the shared Hibernate module, depend on many different instances of the Envers jar (in the application), it might be easier to have an Envers module that works with the Hibernate module. I'm working on one more change for 7.0.1, to use module slots (AS7-1439) instead of different module names, for the different versions of Hibernate modules (e.g. module org.hibernate == hibernate 4, org.hibernate:3 == hibernate 3). When the module alias feature is in AS7, we can also create org.hibernate:4 for the Hibernate 4 version.
For packaging Hibernate + Envers with the application, using the latest AS7.0.1 source and following "Packaging the Hibernate 3.x JPA persistence provider with your application" instructions on https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide, should be helpful.
-
18. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 2, 2011 12:33 PM (in response to alesj)Well ... I tried, and it doesn't
Adam
-
19. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 2, 2011 12:40 PM (in response to adamw)Maybe ServiceLoader.load(Integrator.class) gets confused somehow with AS7's classloaders.
Are the files inside META-INF/services visible inside a module?
Adam
-
20. Re: Trying to use Envers with AS-provided Hibernate
alesj Aug 3, 2011 5:37 AM (in response to adamw)Are the files inside META-INF/services visible inside a module?
For a module, I think they need to be explicity exposed.
Dunno for deployments.
-
21. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 3, 2011 6:15 AM (in response to alesj)And how to explicity expose something?
Adam
-
22. Re: Trying to use Envers with AS-provided Hibernate
alesj Aug 3, 2011 6:21 AM (in response to adamw)And how to explicity expose something?
See some modules.xml for an example (imo, resteasy' should have it) and/or rtmf. ;-)
-
23. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 3, 2011 7:15 AM (in response to alesj)Ales Justin wrote:
See some modules.xml for an example (imo, resteasy' should have it) and/or rtmf. ;-)
Didn't find anything; there's a way to explicitly import services, but what about exporting? I think it's exported by default.
As for rtmf: I'd love to, is there a manual for jboss modules? (couldn't find the project page)
Adam
-
25. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 3, 2011 8:38 AM (in response to nickarls)lol thanks! I was trying to click through to it, sorry .
Anyway, I don't see an option there which could help with Envers and Hibernate discovering the META-INF/services. So still no way to use Envers in AS7.
Adam
-
26. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 3, 2011 9:03 AM (in response to smarlow)Ah, so in 7.0.1 I will be able to simply bundle whole Hibernate - either 3 or 4 as I understand; that should work.
Strong wrote on the hibernate-dev list that adding Envers as a module is almost done. I'm curious what changes will it need and how it will work .
Thanks,
Adam
-
27. Re: Trying to use Envers with AS-provided Hibernate
smarlow Aug 3, 2011 9:35 AM (in response to adamw)Yes, Strong started working on envers support for AS 7.0, but didn't finish it yet. Lets see what he comes up with for a patch, I think he is getting close. I'd like to first see it work with the Hibernate 4 module that is packaged with AS7.
-
28. Re: Trying to use Envers with AS-provided Hibernate
adamw Aug 3, 2011 12:53 PM (in response to alesj)I think I hacked it. You need to:
1. Add Envers jar to the org.hibernate module
2. In the .war, create an META-INF/services/org.hibernate.integrator.spi.Integrator file with "org.hibernate.envers.event.EnversIntegrator" inside.
Then Hibernate picks it. No idea why the META-INF/services/... file inside the Envers jar isn't picked up ...
Adam
-
29. Re: Trying to use Envers with AS-provided Hibernate
jaikiran Aug 3, 2011 1:07 PM (in response to adamw)META-INF/services of a module dependency are not automatically made visible to the module classloader. You have to do it explicitly like this:
Dependencies: org.mymodule services
See the "Dependencies: Manifest Entries" section here https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7