File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Integrating Hibernate with EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Integrating Hibernate with EJB" Watch "Integrating Hibernate with EJB" New topic
Author

Integrating Hibernate with EJB

vinoth subramaniam
Ranch Hand

Joined: Jul 05, 2008
Posts: 47
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

Joined: Jul 05, 2008
Posts: 47
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

Joined: Jun 20, 2005
Posts: 112
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

Joined: Jul 05, 2008
Posts: 47
can you please explain me in detail. thanks ..!
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Jul 05, 2008
Posts: 47
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

Joined: Jun 20, 2005
Posts: 112
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integrating Hibernate with EJB