Home » Eclipse Projects » EclipseLink » Multiple JPA Persistences loading issue in JBOSS 5(Multiple products with in same JBOSS Issue)
Multiple JPA Persistences loading issue in JBOSS 5 [message #1064224] |
Tue, 18 June 2013 10:30 |
|
Hello Every One!!
I have two projects "ProjectA.war" and "ProjectB.war".
In both projects, i am using Oracle 11g, JPA2 with EclipseLink 2.4.2.
and i am using JBOSS 5.1.0 GA application server.
Both have different persistence.xml files with different persistence-unit names, different datasource files.
Here i am connecting same Oracle DB user for both projects.
My Problem is...
First i had deployed ProjectA.war in server. And it is working fine. and DB operations also working fine.
Now i am deploying the ProjectB.war in server besides of ProjectA.war.
So, when i am trying to perform the db operations on ProjectA.war then jboss is searching the POJO classes in ProjectB.war's persistenece.xml file with the help of ProjectB's persistence-unit name.
But actually it need to search in ProjectA.
My ProjectA.war Configurations in the attached document "Project_A.xml".
My ProjectB.war Configurations in the attached document "Project_B.xml".
And the console error was described in the attached document "Console_Error.log".
In above error description....
"INFO [IportIBEntity] finding IptUsers instance with property: userCode, value: ADMIN"
here IportIBEntity is the persistence-unit of ProjectB.war, but IptUsers pojo have in ProjectA.war. So, it is trying to search the pojo in ProjectB.war instead of ProjectA.war
Please help me to solve the problem....
SRIHARIRAO M,
Software Developer,
HYDERABAD.
------------------------------------
JAVA SE 6, JAVA EE 6, Struts 2.x, Spring 3.x, JPA, EclipseLink, TopLink, JAX-WS, jQuery, JSON, Apache Tomcat 6.x, JBoss-5.1.0.GA, Eclipse, MyEclipse, Linux, Windows.
|
|
| |
Re: Multiple JPA Persistences loading issue in JBOSS 5 [message #1064420 is a reply to message #1064304] |
Wed, 19 June 2013 08:05 |
|
Hi James,
Thanks for your reply.
OK, i know that if i want to access the ProjectA classes through ProjectB then i need to be declare in ProjectB's persistence.xml.
But here my problem is i am not accessing the ProjectA classes in ProjectB.
At projects loading time, Jboss searching the classes in ProjectB instead of ProjectA.
Actually IptUsers table have in ProjectA's persistence.xml.
When i want to access the IptUsers table through ProjectA, then it is searching in ProjectB's persistence.xml file. But it should be search in ProjectA.
Please help me...
SRIHARIRAO M,
Software Developer,
HYDERABAD.
------------------------------------
JAVA SE 6, JAVA EE 6, Struts 2.x, Spring 3.x, JPA, EclipseLink, TopLink, JAX-WS, jQuery, JSON, Apache Tomcat 6.x, JBoss-5.1.0.GA, Eclipse, MyEclipse, Linux, Windows.
|
|
| |
Re: Multiple JPA Persistences loading issue in JBOSS 5 [message #1065891 is a reply to message #1064486] |
Fri, 28 June 2013 07:29 |
|
Hi Chris Delahunt,
Thanking you for your reply.
Sorry for delay response...
Quote:Are you sure your issue is related to project B? The error doesn't seem to reference anything in project B, and I would assume that you would get issues accessing persistence-unit "Entity" from the PersistenceProvider class
When i am deploying only ProjectA or only ProjectB then it is executing successfully. But if i merged both the product then it is showing the above error.
Yes your are right, here the problem with persistence-unit problem. It is unable to call the "Entity" object.
"INFO [IportIBEntity] finding IptUsers instance with property: userCode, value: ADMIN"
If we can observe the above code, here "IportIBEntity" is the ProjectB's persistence-unit name. But "IptUsers" is the db table's pojo reference which was mentioned in ProjectA's persistence.xml
Quote:Does this happen when the server is restarted? On first deployment? How are you accessing the EntityManager and EMFs?
The above issue is showing when the JBOSS loading time.
I am accessing the EntityManager by using the code which was attached this post. (This code is for ProjectA)
SRIHARIRAO M,
Software Developer,
HYDERABAD.
------------------------------------
JAVA SE 6, JAVA EE 6, Struts 2.x, Spring 3.x, JPA, EclipseLink, TopLink, JAX-WS, jQuery, JSON, Apache Tomcat 6.x, JBoss-5.1.0.GA, Eclipse, MyEclipse, Linux, Windows.
[Updated on: Fri, 28 June 2013 07:39] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 24 18:17:02 GMT 2024
Powered by FUDForum. Page generated in 0.03612 seconds
|