• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Configure hibernate 3 in Jboss7

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I 'm trying to set up a Spring MVC + Hibernate WAR for deployment to Jboss 7.1.1 Final. My application using Hibernate 3.6.1 & So far my understanding is that Hibernate 4 is packaged with the AS and is the default persistence provider. I am not using persistent.xml file configuration.

I have followed all steps required to setup Hibernate 3 in JBoss.

Go to the AS installation and change into the modules/org folder.
Created folder for slot 3 to hold Hibernate 3
Copied the Hibernate3 jars into this new AS/modules/org/hibernate/3 folder (hibernate3-core.jar, hibernate3-commons-annotations.jar, hibernate3-entitymanager.jar, dom4j.jar, slf4j.jar, slf4j-api.jar, commons-collections.jar, antlr.jar, slf4j-api.jar, commons-collections.jar, antlr.jar and any other jar needed for Hibernate 3)
Created the AS/modules/org/hibernate/3/module.xml file with contents:


My pom.xml(part):



My hibernate-context.xml(Part)



My hibernate.cfg.xml


I have provided all required java still I am still getting following exception, Can anyone help me to setup hibernate 3 related changes in JBoss?

 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you link your application with the JBoss modules?
 
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't it possible to just include the Hibernate JAR files in your WAR? I wouldn't go as far as possibly crippling JBoss itself by downgrading a module that may be (probably is) essential to JBoss itself.
 
Bartender
Posts: 20940
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's "Hibernate" Hibernate, and then there's Hibernate JPA.

I've been using Hibernate JPA in Tomcat webapps for a long time, and I'm not sure that I had to make any changes to transition to Hibernate 4. I think it was mostly added features. So the first question is: is it actually necessary to downgrade to Hibernate 3 to run your app.

Unlike Tomcat, JBoss/Wildfly has JPA/EJB built in, since it's a full-stack JEE server. While I haven't read the latest docs in detail, you probably CAN fall back to Hibernate 3 by setting some web.xml or hibernate config parameters and including Hibernate 3 jars in the WAR/EAR for the app in question. That's what you'd do if you needed to downshift to an earlier implementation of JSF, since JSF is also built into the latest releases of JBoss, owing to its status as part of the JEE standard.

One thing I don't recommend is to go in and muck around with the Wildfly libraries themselves. That's likely to have unpredictable - and probably unpleasant - results, not only for the app in question but everything else that's part of or controlled by the server.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!