3 Replies Latest reply on Aug 30, 2011 3:28 AM by jaikiran

    JB7 implicit dependencies visibility

    akrestan

      I have a problem deploying EAR with Hibernate Envers 4 used by one of the EJB modules on JB7, but the problem seems to be more generic:

       

      Envers JAR is a META-INF/services SPI service provider. The service interface is org.hibernate.integrator.spi.Integrator and comes from Hibernate Core, which is an implicit dependency added by the app. server for deployments using JPA. By default Envers JAR is not part of the implicitly added module with Hibernate dependencies and has to be added to the application. In such scenario deployment ends up with

       

      [org.jboss.modules] (MSC service thread 1-14) Failed to define class org.hibernate.envers.event.EnversIntegrator in Module "deployment.xxx-2.0-SNAPSHOT.ear.hibernate-envers-4.0.0.CR1.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/hibernate/env

      ers/event/EnversIntegrator (Module "deployment.xxx-2.0-SNAPSHOT.ear.hibernate-envers-4.0.0.CR1.jar:main" from Service Module Loader

      ...

      ...

      ...

      Caused by: java.lang.ClassNotFoundException: org.hibernate.integrator.spi.Integrator from [Module "deployment.xxx-2.0-SNAPSHOT.ear.hibernate-envers-4.0.0.CR1.jar:main" from Service Module Loader]

       

      What needs to be done to make implicitly added dependencies accessible to JARs in EAR? I can think of 2 workarounds: one to bundle the whole Hibernate to the application, second to add Envers to the implicitly added module with Hibernate dependencies but I don't like either of the solutions.

       

      Thanks

       


      Ales