• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to deploy Hibernate application on JBoss server - help necessary  RSS feed

Witold Marshal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for a good description how to deploy hiberante libraries and application (for example EJB that uses Hibernates Seesion for performing some database actions ) on JBoss (I use 6 version) and I can't find a consistent approach to this case. Can anyone put some light on this issue because I'm wasting hours on thing that I susspect should be easy with appropriate instructions.
I was reading some articles like this:
and I am getting mor confused.
Please let someone explain me some basic things.
Lets assume that I want to make an EAR with EJB that usese Hibernate libraries.
First of all where should i place Hibernate Libraries ? Sshould they be in thie EAR (lib directory) or should they be deployed on server (servers "lib" directory)?
In the articles given above they don't mention about it.
They are using some service-hibernate.xml file in this projects for (as I susspect ) configuring SessionFactory. But does it mean that basic configuration file hibernate.cfg.xml is no longer needful? As I was convinced the cfg.xml is a basic file for Hibernate and there should be placed settings for configuring SessionFactory in managed environment (server). I am thinking about properties for SesionContext, JTAFactory or Transaction Manager Lookup. Should I set those properties in service-hibernate.xml instead of cfg.xml?
What about utility class usually named as HibernateUtil which was producing SessionFactory singleton instance from cfg? Is it needless too? What causes SessionFctory to be created? server itself without any "builtSessionFctory()" call?

There is reportedly a second approach to this development with JMX service. But it is not well described too. In some articles it is mentioned taht I have to add only jboss-service.xml file to Meta-INF of my EAR. In some places they write that I should bulid special SAR archieve with this jboss-service.xml and Hibernate libraries.
Does this approach not use cfg.xml file and HibernateUtil class too?

If you have any information about it or link to good article (on time), please write it down because I am really tired with this subject.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!