This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes JPA with JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA with JSF" Watch "JPA with JSF" New topic

JPA with JSF

zabin shariff

Joined: Jun 03, 2010
Posts: 19
Hi there

I want to create a JSF project with JPA. I am using eclipse 3.5. How can I integrate both in one project?
I read somewhere that keeping JSF and JPA project separately is a good practice, but I don't know how to do this. If I am using two different projects that is for JSF one project and JPA another how do I integrate and make it working depending on each other?

Please give me some inputs.
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Create project for JPA & another one for JSF. Since JSF will be using JPA add a dependency between JSF & JPA, can be done via adding to java build path of project
zabin shariff

Joined: Jun 03, 2010
Posts: 19
Hi Rishi
Thank for the reply.

I have created two different projects for JPA and JSF and have connected by build path. Have to work on the entity manager part, which I want to use in my JSF project. Will work on that and get back.
zabin shariff

Joined: Jun 03, 2010
Posts: 19
Hi there.

I tried by creating two different projects for JPA and JSF. Wrote build.xml for both to have the class path entry properly.
But I am getting this error:

Here is what exactly I am doing:
JPA Test (its a project): in which JPA is configured and the persistence.xml is written

In the source of this project I have the persistence classes and a connection class.
Connection Class:

The next Project is for JSF which is call RackRate. This has all the JSF capability. Now in my jsp I am calling one bean called RackRateAction.
It contains:

Can you suggest me where i m going wrong?

zabin shariff

Joined: Jun 03, 2010
Posts: 19
Hi there.

Now I tried both JPA and JSF in one project and it is working now

Check these site for more help:

Venkat basa

Joined: Oct 30, 2012
Posts: 9

please create a jsf(Dynamic web project)

and go to your project properties(jsf project)

select Project Facets

in that wizard,select Jpa

then press OK,now your project is configure with jsf+jpa

I agree. Here's the link:
subject: JPA with JSF
It's not a secret anymore!