• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

persistence unit scope

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Straws are for suckers. Now suck on this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic