users@glassfish.java.net

Re: toplink-persistence : creating several EMFs simulatenously Java SE mod

From: <glassfish_at_javadesktop.org>
Date: Thu, 09 Aug 2007 02:19:22 PDT

Hello Sahoo,

Thank you for your prompt replies.

Yes, each Web app packages it own persistence.xml.

The exception is classnotfound on the entity class declared in the second persistence.xml. So evidently persistence.xml is picked up.

Following is the exception (trimmed for clarity):
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named pu2: Provider named oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider threw unexpected exception at create EntityManagerFactory:
oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Local Exception Stack:
Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0 (Build 58 (08/05/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: java.net.URLClassLoader_at_35ce36
Internal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build 58 (08/05/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [pu1] failed.
Internal Exception: Exception [TOPLINK-30007] (Oracle TopLink Essentials - 2.0 (Build 58 (08/05/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while loading class: entity.Customer to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
Internal Exception: java.lang.ClassNotFoundException: entity.Customer
        at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:143)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:169)

EMF for pu2 is created before this exception is thrown.
The source code that replicates this is attached with the bug logged.

-Prashant
[Message sent by forum member 'cprashantreddy' (cprashantreddy)]

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