This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

Ryan Rha

Greenhorn
+ Follow
since Mar 31, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ryan Rha

What it changed is the declaration of the LocalContainerEntityManagerFactoryBean , in the failing configuration i was declaring a persistenceUnitManager that load my persistence.xml config and referencing it in the LocalContainerEntityManagerFactoryBean
in the working config the LocalContainerEntityManagerFactoryBean , i provided the dataSource , the package to scan where my entities are ,and the jpa implementation (hibernate).
that is the main difference , i looking now on to the source of Spring LocalContainerEntityManagerFactoryBean to see how things works for the two config .
7 years ago
Hi Tim ,

Thank you for your reply , y re right , that was about the LocalContainerEntityManagerFactoryBean configuration ,
There are many ways to declare the persistence configuration ,my first configuration use a persistenceUnitManager and was like this


and i changed it like this


but i dont understand why the first way fails .

Thanks.
7 years ago
Hi , it say's that it didn't find your persistence configuration. check inside your deployed war if the META-INF directory is under classes and it contains your persistence.xml file.
7 years ago
Hi ,
I m using JSF 2.0 with Spring 3.2.8 and JPA 2.0 and hibernate 4.2.11.Final, and i have an issue, i'm struggling more than 2 days now to undestand this problem but i have no explanation for it
actually the flow consist of viewing a list of employees with a Primefaces datatable and then selecting a specific row to set it in the JSF ManagedBean .
The case works perfectly when the JSF Managed Bean scope is set to SessionScoped
But when i change the scope to ViewScoped , the list is loaded with no problem but when i select a row the ajax request returns an error and here is the XML response :


when i debuggued the hibernate class that is throwing the exception , EntityManagerFactoryRegistry.getNamedEntityManager Factory it finds 2 already registred EntityManagerFactory . i dont understand who did register them and when and why the case does only occur when using ViewScoped JSF Beans (i'm not using CDI anywhere)
here is my managed bean

The Dao

I'm using extended EntityManager because i have Lazy relationsShip in my model , so i'm calling close method on the persistent context at the end of my flow.
Any one have idea what's the matter with the ViewScoped within Spring or may be it has nothing to do ( i m saying so because it just work fine with SessionScoped but i don't won't to have My Beans as Session Objects)

Thank's for your Help.

Ryan
7 years ago