users@glassfish.java.net

Re: JPA and multiple entities jar

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 May 2007 01:17:21 PDT

First case:

an EAR "test.ear" (using ear 5.0 descriptor) containing:
  1. "lib/base-entities.jar" that contains a base entity class using
     annotation and a "META-INF/persistence.xml"
  2. "lib/other-entities.jar" that contains another entity class using
     annotation *without* a "META-INF/persistence.xml"
  3. "ejb.jar" a EJB 3.0 jar with a stateless session bean that use both
     base entity and another entity.
  4. "web.war" a Web Archive (Servlet 2.5) that use the stateless ejb

When I try to use the second entity the following exception is throwed:

Caused by: Exception [TOPLINK-8006] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: A problem was encountered resolving the class name - The descriptor for [OtherEntity] was not found.
        at oracle.toplink.essentials.exceptions.EJBQLException.missingDescriptorException(EJBQLException.java:158)
...

Second case:
 the same EAR *with* the same "META-INF/persistence.xml" inside
"lib/other-entities.jar".

The following exception is genereted during the deploy (asadmin deploy):

Exception Description: Missing meta data for class [test.BaseEntity]. Ensure the class is not being excluded from your persistence unit by a <exclude-unlisted-classes>true</exclude-unlisted-classes> setting. If this is the case, you will need to include the class directly by adding a <class>[test.BaseEntity]</class> entry for your persistence-unit.
Local Exception Stack:
Exception [TOPLINK-7243] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.Validation
Exception
Exception Description: Missing meta data for class [test.BaseEntity]. Ensure the class is not being e
xcluded from your persistence unit by a <exclude-unlisted-classes>true</exclude-unlisted-classes> setting. If this is the cas
e, you will need to include the class directly by adding a <class>[test.BaseEntity]</class> entry for
 your persistence-unit.
        at oracle.toplink.essentials.exceptions.ValidationException.classNotListedInPersistenceUnit(ValidationException.java:
2120)

Thanks, bye
[Message sent by forum member 'smoretto' (smoretto)]

http://forums.java.net/jive/thread.jspa?messageID=216274