Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 48742 invoked from network); 27 Jan 2010 18:53:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2010 18:53:28 -0000 Received: (qmail 67119 invoked by uid 500); 27 Jan 2010 18:53:28 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 67087 invoked by uid 500); 27 Jan 2010 18:53:28 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 67077 invoked by uid 99); 27 Jan 2010 18:53:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 18:53:28 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ljnelson@gmail.com designates 209.85.210.185 as permitted sender) Received: from [209.85.210.185] (HELO mail-yx0-f185.google.com) (209.85.210.185) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 18:53:21 +0000 Received: by yxe15 with SMTP id 15so3183604yxe.9 for ; Wed, 27 Jan 2010 10:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=A6UkCHE7nGiKKPdUC80TDEA8N+XF2oQCP1a35CSMZE8=; b=rliCZt4fTqCeHe92PwPGFzWYOJUG5idZHvceLsPxg/MoFGWoHhyWNr5D+u6tFaw/Jr XpWSV2fWWM6QvsTxHpP0wdaA0DGmdYFPt9vG9cKMWsJUnRFYqkfTet9ViDM4PWzRC+GD ldN72FXpiU/kNq6OXdDhVz4p2ucXRNWEOoqig= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vUA6LTzJLVX0gS3Fwxgid/z9MctQFGgUbxggiNgXkWetZu74Ktzi/wO+GEykJsPVXe 5MV9McW1IDXrRXdAl3gtbR/e+4MG2jSgEf7tU89ze+5xkYA4aH0Gh1MyGiEXrA8ZQ5e7 GH80QpTd0BrSmUj5+aMzi4nG+TCFrlmvq1+JA= MIME-Version: 1.0 Received: by 10.150.171.13 with SMTP id t13mr13226634ybe.150.1264618380341; Wed, 27 Jan 2010 10:53:00 -0800 (PST) Date: Wed, 27 Jan 2010 13:53:00 -0500 Message-ID: <2c0ebf0c1001271053v5f0cce94qbd043b30131643c1@mail.gmail.com> Subject: Getting META-INF/persistence.xml read? From: Laird Nelson To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=000e0cd5c6f4563277047e29e98a --000e0cd5c6f4563277047e29e98a Content-Type: text/plain; charset=ISO-8859-1 I'm creating a tool that uses the JDBCConfigurationImpl() class. I was under the impression that somehow this class is capable of finding the META-INF/persistence.xml file if it is present on the classpath, thus setting things like the database user name, the password, the connection url, and so forth. Despite the fact that my JUnit test case that I'm trying to make pass is running with a classpath that serves as the root for an existing META-INF/persistence.xml file, that file is never seen, and the moment I try to get JDBCConfigurationImpl to get a DataSource, everything blows up. I looked at the source code of the ReverseMappingTool's main() method to see how it does it, on the theory that maybe this was a case of cut-and-paste-development--perhaps the ReverseMappingTool, the SchemaTool, etc. all have their own way of locating this file? But I saw (a) no such code, and (b) no code anywhere inside ReverseMappingTool that tries to process the "-properties" command line argument. This leads me to believe that some other class is processing the "-properties" command line argument, and I thought that if such an argument were not present, then it would suffice to simply have a META-INF/persistence.xml on the classpath. No such luck. Any ideas? For the record, I find the whole "plugin" pseudo-dependency injection approach arcane, unreliable and confusing. Best, Laird --000e0cd5c6f4563277047e29e98a--