Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 31862 invoked from network); 17 Aug 2006 22:44:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Aug 2006 22:44:33 -0000 Received: (qmail 56460 invoked by uid 500); 17 Aug 2006 22:44:33 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 56433 invoked by uid 500); 17 Aug 2006 22:44:33 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 56424 invoked by uid 99); 17 Aug 2006 22:44:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2006 15:44:33 -0700 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_10_20,HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 63.246.7.35 is neither permitted nor denied by domain of bwnoll@gmail.com) Received: from [63.246.7.35] (HELO mail.virtuas.com) (63.246.7.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2006 15:44:31 -0700 Received: (qmail 14207 invoked by uid 89); 17 Aug 2006 22:44:10 -0000 Received: by simscan 1.1.0 ppid: 14196, pid: 14199, t: 7.5402s scanners: clamav: m: spam: 3.0.2 Received: from unknown (HELO ?127.0.0.1?) (bnoll@virtuas.com@71.216.65.30) by smtp.virtuas.com with SMTP; 17 Aug 2006 22:44:02 -0000 Message-ID: <44E4F131.9070001@gmail.com> Date: Thu, 17 Aug 2006 16:44:01 -0600 From: Bryan Noll User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: open-jpa-dev@incubator.apache.org Subject: Re: [jira] Commented: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib' References: <20240359.1155854116480.JavaMail.jira@brutus> In-Reply-To: <20240359.1155854116480.JavaMail.jira@brutus> Content-Type: multipart/alternative; boundary="------------060806050908070705000005" X-Antivirus: avast! (VPS 0633-3, 08/17/2006), Outbound message X-Antivirus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on virtuas01.managed.contegix.com X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-5.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, HTML_10_20,HTML_MESSAGE autolearn=ham version=3.0.2 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------060806050908070705000005 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Saw this after I responded... I'll play around with it... Thanks... Abe White (JIRA) wrote: > [ http://issues.apache.org/jira/browse/OPENJPA-14?page=comments#action_12428815 ] > > Abe White commented on OPENJPA-14: > ---------------------------------- > > Note that we already have an available way to set the config file or resource location: > > > > -- or -- > > > > The element also lets you specify any property directly, like: > > > This works b/c our AbstractTask has a createConfig() method that returns the Configuration instance (in this case, an OpenJPAConfiguration or JDBCConfiguration subclass instance depending on the task), so all bean methods are settable. > > The element isn't required, but I agree with Patrick that it shouldn't be, given that we'll detect persistence.xml if it's available in the classpath. IMO, it would be better to fix the NPE to have a good error message than to require an explicit config file declaration. > > >> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib' >> ------------------------------------------------------------------------------------------------------ >> >> Key: OPENJPA-14 >> URL: http://issues.apache.org/jira/browse/OPENJPA-14 >> Project: OpenJPA >> Issue Type: Bug >> Components: lib >> Environment: Windows XP >> Reporter: Bryan Noll >> Assigned To: Bryan Noll >> Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2 >> >> >> Ideally, one should be able to run 'ant openjpac' (openjpac would be a target defined in the build script that would use the PCEnhancer task) without having to put the openjpa jars on the system classpath or having to pass them into ant vie the '-lib' argument. Currently this is not possible. The root of the issue can be seen from by looking at the public static String[] getImplementors(String serviceName, ClassLoader loader) method of the Services class. Basically, the call to >> loader = Thread.currentThread().getContextClassLoader(); >> returns a ClassLoader with the $ANT_HOME\lib\*.jar and $JAVA_HOME\lib\tools.jar in it... which obviously doesn't contain 'META-INF/services/org.apache.openjpa.conf.ProductDerivation' >> The exception seen when encountering this issue: >> java.lang.ExceptionInInitializerError >> at org.apache.openjpa.conf.OpenJPAConfigurationImpl.(OpenJPAConfigurationImpl.java:510) >> at org.apache.openjpa.conf.OpenJPAConfigurationImpl.(OpenJPAConfigurationImpl.java:160) >> at org.apache.openjpa.conf.OpenJPAConfigurationImpl.(OpenJPAConfigurationImpl.java:151) >> at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77) >> at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170) >> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) >> at org.apache.tools.ant.Task.perform(Task.java:364) >> at org.apache.tools.ant.Target.execute(Target.java:341) >> at org.apache.tools.ant.Target.performTasks(Target.java:369) >> at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) >> at org.apache.tools.ant.Project.executeTarget(Project.java:1185) >> at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) >> at org.apache.tools.ant.Project.executeTargets(Project.java:1068) >> at org.apache.tools.ant.Main.runBuild(Main.java:668) >> at org.apache.tools.ant.Main.startAnt(Main.java:187) >> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251) >> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72) >> Caused by: java.util.MissingResourceException: Your system is missing product derivations. Product derivations provide configuration options for supported data stores and specifications. You must have a META-INF/services/org.apache.openjpa.conf.ProductDerivation file in your classpath listing the available derivation classes, and some listed class must be instantiable. Typically this file is bundled as part of the distribution. Have you unbundled it, or unbundled its listed classes? >> at org.apache.openjpa.conf.ProductDerivations.(ProductDerivations.java:53) >> ... 17 more >> > > --------------060806050908070705000005--