Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integrating Hibernate with EJB

 
vinoth subramaniam
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am new to EJB and hibernae.

I am using Hibernate 3.0, Jboss 4.0.2, EJB 2.1.Can you please spend your valualbe time and tell me how to integrate EJB and Hibernate. we plan to use stateless session beans which will call the DAO.

I searched in google and i cant find any answer relavant to me.

1. What are the configurations need to be done in JBOSS. :?:
2. How to access the hibernate session in EJB. :?:

Please explain the steps clearly, So that this thread will be useful to me and others. And i have to solve this issue, As soon as possible. :?

thanks,
Vinoth
 
vinoth subramaniam
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added the DAO in a utility project. And i tried to use the DAO from the EJB directly and i got tghe following error. I didnt do any configurations. Can you please tell me, what are the steps i have to follow.

 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to include apache commons libs to solve the problem.

Follow a nice startup tutorial, that may help: http://www.hibernate.org/82.html
 
vinoth subramaniam
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please explain me in detail. thanks ..!
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vinoth subramaniam wrote:

The mentioned class is missing in classpath. That´s all. Add the class (or actually, the JAR file with the class) to the classpath and the problem should disappear. As the package name already hints, that class is part of the Apache Commons Collections API.
 
vinoth subramaniam
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks, Now i solved the NoclassFoundError problem. I followed this tutorial in the Hibernate site. But it i am stuck in the step 5. Can you please help me out.

1.So i havae to write the jboss-service.xml file to use hibernate3 with jboss 4.0.2 ?
2. How to create the hibernate.sar file using that ant task?

Can you please show me any tutorial which have the step by step guide to do the same.. thanks for spending your time...

Cheers,
Vinoth
 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the example, you are using the Hibernate as a service (the advantage is that you can modify its properties through the JMX console).

You can have more information here: http://acs.lbl.gov/~hoschek/javatree/share/jdbc/hibernate-2.1/doc/66.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic