Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 8858 invoked from network); 7 Jun 2007 06:43:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jun 2007 06:43:51 -0000 Received: (qmail 11394 invoked by uid 500); 7 Jun 2007 06:43:53 -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 10719 invoked by uid 99); 7 Jun 2007 06:43:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 23:43:50 -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, 06 Jun 2007 23:43:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 317B67141A7 for ; Wed, 6 Jun 2007 23:43:26 -0700 (PDT) Message-ID: <26901849.1181198606200.JavaMail.jira@brutus> Date: Wed, 6 Jun 2007 23:43:26 -0700 (PDT) From: "Matthew T. Adams (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Updated: (JDO-494) ERROR org.apache.tools.ant.AntClassLoader running maven build on api2 In-Reply-To: <994312.1181156495491.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-494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthew T. Adams updated JDO-494: --------------------------------- Attachment: jdo-494.patch When running the JDOHelperConfigTest via the Maven-1 command line, the ClassLoader is of subtype AntClassLoader, not URLClassLoader. This introduces a test-time dependency on Ant; the only version of Ant that I could find via a Maven repository is 1.7.0 at http://repo1.maven.org/maven (specifically, http://repo1.maven.org/maven/org.apache.ant/jars/ant-1.7.0.jar); I think 1.6.5 would be preferable, but I can't find one that's properly publicly hosted. If the ClassLoader is not of subtype URLClassLoader or AntClassLoader, an exception is thrown -- I could see no better way of doing this. I tested from scratch (meaning that I deleted ~/.maven and trunk/api20/target before testing) on JDKs 1.4 & 1.5 using Maven versions 1.0.2 & 1.1-RC1 and all four combinations passed. Please review patch. > ERROR org.apache.tools.ant.AntClassLoader running maven build on api2 > --------------------------------------------------------------------- > > Key: JDO-494 > URL: https://issues.apache.org/jira/browse/JDO-494 > Project: JDO > Issue Type: Bug > Components: api2 > Affects Versions: JDO 2 maintenance release 1 > Reporter: Craig Russell > Assignee: Matthew T. Adams > Priority: Blocker > Fix For: JDO 2 maintenance release 1 > > Attachments: jdo-494.patch > > > I get this error when running the api20 maven build from the tip of > the trunk: > Testsuite: javax.jdo.JDOHelperConfigTest > Tests run: 19, Failures: 0, Errors: 18, Time elapsed: 0.124 sec > Testcase: testPositive00_PMF0_GetNamedPMFProperties > (javax.jdo.JDOHelperConfigTest): Caused an ERROR > org.apache.tools.ant.AntClassLoader > at > javax.jdo.JDOHelperConfigTest.testPositive00_PMF0_GetNamedPMFProperti > es(JDOHelperConfigTest.java:57) > The error occurs at the line that constructs a new class loader: > URLClassLoader loader = new JDOConfigTestClassLoader( > JDOCONFIG_CLASSPATH_PREFIX, > (URLClassLoader) getClass().getClassLoader()); > I don't recognize the error. The stack trace doesn't show where in > the constructor the error is. > Any clues? > Craig > public class JDOConfigTestClassLoader extends URLClassLoader { > public JDOConfigTestClassLoader(String partialPathToIgnore, > URLClassLoader unparent) { > this(new String[]{partialPathToIgnore}, unparent); > } > public JDOConfigTestClassLoader(String[] partialPathsToIgnore, > URLClassLoader unparent) { > super(new URL[]{}, null); > addNonTestURLs(partialPathsToIgnore == null ? new String[] > {} : partialPathsToIgnore, unparent); > } > // HACK: need to identify a better way of controlling test classpath > protected void addNonTestURLs(String[] partialPathsToIgnore, URLClassLoader unparent) { > URL[] urls = unparent.getURLs(); > for (int i = 0; i < urls.length; i++) { > URL url = urls[i]; > String urlString = url.toString(); > for (int j = 0; j < partialPathsToIgnore.length; j++) { > if (urlString.indexOf(partialPathsToIgnore[j]) == -1) { > addURL(url); > } > } > } > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.