Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 31751 invoked from network); 17 Aug 2006 22:44:13 -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:13 -0000 Received: (qmail 55711 invoked by uid 500); 17 Aug 2006 22:44:12 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 55636 invoked by uid 500); 17 Aug 2006 22:44:12 -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 55627 invoked by uid 99); 17 Aug 2006 22:44:12 -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:12 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2006 15:44:11 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 438EC7142D0 for ; Thu, 17 Aug 2006 22:41:14 +0000 (GMT) Message-ID: <29212545.1155854474258.JavaMail.jira@brutus> Date: Thu, 17 Aug 2006 15:41:14 -0700 (PDT) From: "Bryan Noll (JIRA)" To: open-jpa-dev@incubator.apache.org Subject: [jira] Commented: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib' In-Reply-To: <29411189.1155750314898.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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/OPENJPA-14?page=comments#action_12428817 ] Bryan Noll commented on OPENJPA-14: ----------------------------------- I thought about making it optional, but it just seemed odd to me that you'd have to have 'META-INF/persistence.xml' in one of the places I mentioned earlier... 1) system classpath 2)$ANT_HOME/lib 3) ant -lib dir_where_META_INF_is 4) I forgot about this before... but a 4th would be ${user.home}/.ant/lib ...in particular, the first two options seem like a round peg in a square hole. Making it optional would be easy, but I just thought making it required would save users the problem of having to get that on their classpath. Maybe I'm not seeing the use case? Like I said though, changing it to optional is trivial. > 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 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira