• 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

Trying to use entities in a library in another EJB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to split my application into four parts:
- a library that contains my entities
- a library that contains remote interfaces
- the server code, using the two libraries to implement the interfaces
- and the application, using the two libraries to query the server and handle display etc.

i have a persistence.xml in the entity library and that works fine. i put the library in the domain1/lib folder in my glassfish. The interfaces also go there.
Now when i use no persistence.xml in my server project the project does not deploy:

Deploying application in domain failed; Deployment Error -- Could not resolve a persistence unit corresponding to the persistence-context-ref-name [aranian.wh40k.server.ejb.WH40kUserValidationBean/em] in the scope of the module called [D:\Projekte\WH40kServer\build\jar]. Please verify your application.


When i use the same persistence.xml as my library (especially unitName) i am able to deploy the server project, but i get an error saying my entity (created in the library) is unknown when i call a remote method from my client:

Caused by: org.hibernate.MappingException: Unknown entity: aranian.lib.entities.test.WH40kTest



i want to split the code into these four parts to keep server and client separate. i guess it would work if everything was in one big project, but i'd like to do it this way. could someone point me in the right direction what i'm missing?

Entity

Interface:


Server


application


persistence.xml (used in both entity library and server)


[ September 13, 2008: Message edited by: aranian ]
[ September 13, 2008: Message edited by: aranian ]
 
I've read about this kind of thing at the checkout counter. That's where I met 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