Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

persistence unit scope

 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I constructed an ear consisting of an ejb-jar and a persistence archive. Both, the ejb-jar and the persistence archive have a persistence unit of the same name.

I try to use the persistence archive's persistence unit in the ejb using the # syntax as described in JSR 220 (JPA pdf), 6.2.2 (page 141).

Unfortunately this results in the following runtime exception:

Unknown entity bean class: class persistence.Customer, please verify that this class has been marked with the @Entity annotation

If the persistence.xml file is removed from the ejb-jar everything works fine!

I'm using glassfish / oracle-toplink-essentials.


Has anyone tried a similar scenario with this app serv / persistence provider ? Did it work ?

Thanks for your help.

Ralph
 
Anish Mathur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you declared the entity name in persitence.xml?
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anish Mathur,

thanks for your reply. No, I didn't use the <class>-tag. The details are as follows: The result is "Unknown entity bean class: class entities.GlobalCustomer, please verify that this class has been marked with the @Entity annotation".

I also tried

name="lib/p-archive.jar#PUnit"
name="p-archive.jar#PUnit"

with the same result. But if the persistence.xml-file is removed from test-ejb.jar it works (for all versions of name="...#PUnit").

Now I don't know, wether something is wrong with my packaging, etc. or it's a bug in the environment.
[ October 17, 2008: Message edited by: Ralph Jaus ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic