This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am writing a application in which following JPA file,will be accessed from different application.
To do this i created .jar file of following java file and added in classpath of server.
I created testclient.jar(entity.library.TestJPA.class) and added this jar in classpath of weblogic server.(I can see entry of jar in classpath of weblogic server.)
I am accessing this JPA file from .ear module.
But getting some error while deploying on weblogic server
After debugging i found that when i remove following line
Then test1.ear file is successfully deployed,But if i remove <jar-file> tag in persistence.xml then how i will access TestJPA class.I dont want to bundle this TestJPA class in each .jar file deployed on weblogic server.
I have to access this TestJPA.class file from multiple session bean of.jar files deployed on weblogic server.
Approach 1 is i deploy TestJPA.class with each .jar file deployed on weblogic server.But i dont want this approach.
If anyone know any better way to handle this?
As suggested by you i used <class> tag in persistence.xml and ears were deployed on server successfully.
I created two ears test.ear and test1.ear....
test.ear is updating some vaue(Updating studentName corresponding to studentId) in database table using TestJPA class with following persistence.xml (TestJPA class is added in weblogic server's classpath.)
The value is succesfully updated in table successfully. I can see the value in database table by sql-query on sqlplus.
From test1.ear i accessed same database-table value using TestJPA class with following persistence.xml (Selecting all rows from student_tables table)
But i am getting my previous database table values. I am not able to access database values updated by test.ear module.
After debugging i found that when i redeploy test1.ear then only i can retrieve updated values. What can be possible reason ? Please reply!