1

I'm migrating my project to JBoss AS 7, and I've read a little about its modules. My problem is simple (I think), I have no idea how to include this modules during development phase. For example, I use hibernate, and inside Eclipse, with JBoss Tools and JBoss AS 6, I just need to say that the project will use JBoss 7 and all their "jars" are available. But using JBoss 7, hibernate-core isn't available to me. I know I have an option to add the hibernate-core as "provided" on my pom, but there is another way?

Montolide
  • 773
  • 3
  • 12
  • 27

2 Answers2

3

I would say adding the hibernate-core as "provided" on your pom and adding

Dependency: org.hibernate

to your META-INF/MANIFEST.MF or

<dependencies>
    <module name="org.hibernate" />
</dependencies>

to jboss-deployment-structure.xml is the way to go. This way you get runtime access to Hibernate bundled with JBoss without including them in your deployment. Just make sure you use the same version of Hibernate that comes with JBoss (Hibernate 4.0.1 for JBoss AS 7.1.1). Also check out the Developer Guide.

Philippe Marschall
  • 4,452
  • 1
  • 34
  • 52
  • Yeap, but adding the full api as altanis said goes better, since I have all available jars of JBoss. But I think I also need that Dependency, because I was getting errors on runtime, thanks! – Montolide May 09 '12 at 12:19
  • Hello. This does not work for me. I have JBoss AS 7.1.1. Hibernate 4.0.1.Final is set as provided in pom.xml. Whem I try `jboss-deployment-structure.xml`, I get the following errors : `org.jboss.resteasy.spi.UnhandledException: java.lang.ExceptionInInitializerError` and `org.hibernate.MappingException: Unable to create AuditStrategy[org.hibernate.envers.strategy.DefaultAuditStrategy] instance.` And if I use the manifest solution, I get as error `java.lang.NoClassDefFoundError: org/hibernate/HibernateException`. I'm using a Netbeans Maven Web Application project template – Kurt Miller Jan 04 '19 at 14:39
  • I also tried using this solution but without success https://stackoverflow.com/a/30759509/5618563 ... I get here java.lang.NoClassDefFoundError: org/hibernate/HibernateException. Of course when I use runtime or compile scope in pom.xml, the app works well – Kurt Miller Jan 04 '19 at 14:41
2

Take a look at these links:

Sebastian Łaskawiec
  • 2,667
  • 15
  • 33