In addition to what Pavel suggests, a third option would be to create a
JAR containing the entities and the persistence.xml file and put it in
the library directory of the EAR. The entities and the persistence unit
would then be visible to all modules in the application.
Erno
Pavel Buzek wrote:
> That's correct. The persistence classes are in EJB module along with
> the persistence.xml. But the controller classes which are trying to
> access the entity classes are in the WAR. You have to define
> persistence.xml in the project where you use it. Either use a session
> facade and keep the persistence.xml in EJB module or create a
> persistence.xml in WAR module. Note that in the later case you also
> have to list the jar file of EJB module in persistence.xml so that the
> entity manager can find the classes - it normally only looks in the
> current module.
>
> hope this helps
>
> -pavel
>
> David W. Van Couvering wrote:
>> I'm pretty much a newbie when it comes to the new Java Persistence
>> stuff, but it sure seems to me that the Glassfish persistence code
>> (e.g. TopLink) is not able to find the descriptors for the entity
>> classes it is trying to persist. This is either because it can't
>> find the persistence.xml file or the persistence.xml file is missing
>> the descriptor for the entity class.
>>
>> I am copying the glassfish persistence team as this is their area of
>> expertise.
>>
>> David
>>
>> Rajesh Chenji wrote:
>>> Hi All,
>>>
>>> We have one of our customer trying run a simple Enterprise
>>> Application which uses Entity Beans & JSF using MySQL 4.1.Attached
>>> are the sample project & issue details.
>>>
>>> I tried to work out the same issue using default derby database
>>> which is bundled with Netbeans 5.5.But i keep encountering the
>>> following exception which the customer also encounters
>>>
>>> *exception*
>>>
>>> javax.servlet.ServletException: Exception Description: A problem was
>>> encountered resolving the class name - The descriptor for
>>> [Reservation] was not found.
>>>
>>> *root cause*
>>>
>>> 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 [Reservation] was not found.
>>>
>>> Please refer the following attached documents for more details
>>>
>>> Regards
>>> Rajesh Chenji