It's pretty much defined by the spec that Persistence class just delegates to
the providers to do the work and has no way to report the errors:
7.2 Bootstrapping in Java SE Environments
The Persistence bootstrap class will locate all of the persistence providers
<...> and call createEntityManagerFactory() on them in turn until an appropriate
backing provider returns an EntityManagerFactory.
If a provider does not qualify as the provider for the named persistence unit,
it must return null when createEntityManagerFactory is invoked on it.
Craig L Russell wrote:
FYI, Persistence is an open source project at Glassfish.
Anyone, even an OpenJPA contributor, who wants to contribute to the
project for example to improve the error messages, is welcome to look
at the sources and provide a patch. I know people who will be happy to
commit usability patches. ;-)
On Apr 10, 2007, at 1:54 PM, Pinaki Poddar wrote:
The error message could have been more specific in the following way:
a) no META-INF/persistence.xml has not been found in classpath
b) META-INF/persistence.xml has been found but there is no 'ode-store'
unit defined in it.
c) META-INF/persistence.xml has been found but provider can not be
When I first encountered this error, my interpreation was (b) from the
way the message was worded.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jacek
Sent: Tuesday, April 10, 2007 2:52 PM
Subject: Re: Testing an OpenJPA module
On 4/10/07, Marc Prud'hommeaux <[EMAIL PROTECTED]> wrote:
Glad you got it fixed. It's annoying that
javax.persistence.Persistence doesn't provide more of a clue as to why
I wonder what else you'd like to see other than what's already printed
out? It tells exactly why it's failed - "No Persistence provider for
EntityManager named ode-store" is just a JPA version of
"NoClassDefFoundError" in "pure" Java.
Notice: This email message, together with any attachments, may
contain information of BEA Systems, Inc., its subsidiaries and
affiliated entities, that may be confidential, proprietary,
copyrighted and/or legally privileged, and is intended solely for
the use of the individual or entity named in this message. If you are
not the intended recipient, and have received this message in error,
please immediately return this by email and then delete it.
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!