Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 37680 invoked from network); 29 Aug 2007 04:43:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Aug 2007 04:43:52 -0000 Received: (qmail 57777 invoked by uid 500); 29 Aug 2007 04:43:48 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 57766 invoked by uid 99); 29 Aug 2007 04:43:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Aug 2007 21:43:47 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 04:43:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7C19371418F for ; Tue, 28 Aug 2007 21:43:31 -0700 (PDT) Message-ID: <31599202.1188362611505.JavaMail.jira@brutus> Date: Tue, 28 Aug 2007 21:43:31 -0700 (PDT) From: "Matthew T. Adams (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Updated: (JDO-523) Misleading error msg raised by JDOHelper.getPersistenceManagerFactory(arg) if the resource in arg does not exist In-Reply-To: <31751062.1187944351326.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JDO-523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthew T. Adams updated JDO-523: --------------------------------- Attachment: JDO-523.patch OK, so it turns out that I did have a test case for that, but since all of these exceptions are of the same type (JDOFatalUserException), it was only the error text that changed, and I'm not checking the error text in my unit tests. I identified a bug thanks to the stack trace given, and I believe that it's fixed. Erik (or anyone at JPOX), can you try this patch and see if the error makes sense now in your use case? > Misleading error msg raised by JDOHelper.getPersistenceManagerFactory(arg) if the resource in arg does not exist > ---------------------------------------------------------------------------------------------------------------- > > Key: JDO-523 > URL: https://issues.apache.org/jira/browse/JDO-523 > Project: JDO > Issue Type: Improvement > Components: api2 > Affects Versions: JDO 2 maintenance release 1 > Reporter: Erik Bengtson > Assignee: Matthew T. Adams > Attachments: JDO-523.patch > > > > Running the following code, and if the jpox.properties cannot be > > found, a > > misleading message is raised that indicates a missing a EntityManager > > persistence provider, but should actually tell me that my resource > > jpox.properties cannot be found. > > > > PersistenceManagerFactory pmf = > > JDOHelper.getPersistenceManagerFactory("jpox.properties"); > > > > ------------------ > > Exception in thread "main" javax.jdo.JDOFatalUserException: Unable > > to invoke > > javax.persistence.Persistence.createEntityManagerFactory(String) > > at javax.jdo.JDOHelper.getPMFFromEMF(JDOHelper.java:1210) > > at javax.jdo.JDOHelper.getPersistenceUnit(JDOHelper.java:952) > > at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java: > > 894) > > at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java: > > 836) > > at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java: > > 814) > > at org.jpox.persistence.Main.main(Main.java:10) > > NestedThrowablesStackTrace: > > java.lang.reflect.InvocationTargetException > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > at java.lang.reflect.Method.invoke(Unknown Source) > > at javax.jdo.JDOHelper.getPMFFromEMF(JDOHelper.java:1194) > > at javax.jdo.JDOHelper.getPersistenceUnit(JDOHelper.java:952) > > at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java: > > 894) > > at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java: > > 836) > > at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java: > > 814) > > at org.jpox.persistence.Main.main(Main.java:10) > > Caused by: javax.persistence.PersistenceException: No Persistence > > provider for > > EntityManager named jpox.properties > > at > > javax.persistence.Persistence.createEntityManagerFactory > > (Persistence.java:89) > > at > > javax.persistence.Persistence.createEntityManagerFactory > > (Persistence.java:60) > > ... 10 moreg -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.