Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 61333 invoked from network); 10 Aug 2006 09:03:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Aug 2006 09:03:03 -0000 Received: (qmail 10516 invoked by uid 500); 10 Aug 2006 09:03:01 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 10225 invoked by uid 500); 10 Aug 2006 09:03:00 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 10213 invoked by uid 99); 10 Aug 2006 09:03:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2006 02:03:00 -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, 10 Aug 2006 02:03:00 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AE35C71429D for ; Thu, 10 Aug 2006 09:00:14 +0000 (GMT) Message-ID: <18276720.1155200414689.JavaMail.jira@brutus> Date: Thu, 10 Aug 2006 02:00:14 -0700 (PDT) From: "Guillaume Nodet (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Commented: (XBEAN-39) NPE in XBeanHelper.createBeanDefinitionReader with some Classloaders In-Reply-To: <17473326.1155189493825.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/XBEAN-39?page=comments#action_12427148 ] Guillaume Nodet commented on XBEAN-39: -------------------------------------- Could you also indicate which system you use ? It may be useful for other users (and i'm a bit curious ;) ) For the SpringVersion.getVersion problem, I think we could auto-discover the spring version relying on class loaders. Some classes in spring core have been changed in v2 and it should be easy to use that to autodiscover the version instead of relying on another external file. For the second problem, i would suggest to invert the test you added and put it first: protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.debug("Could not find resource: " + uri); } } return in; } This could be used to override an existing xbean mapping definition also. Thoughts ? > NPE in XBeanHelper.createBeanDefinitionReader with some Classloaders > -------------------------------------------------------------------- > > Key: XBEAN-39 > URL: http://issues.apache.org/jira/browse/XBEAN-39 > Project: XBean > Issue Type: Bug > Affects Versions: 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 > Reporter: Stefan Kleineikenscheidt > Attachments: XBEAN-39.patch > > > XBean fails on systems with some classloaders, which do not return sensible values from the following methods > pkg.getImplementationVersion(); or > cl.getResourceAsStream(name); > This leads to > a) a NPE thrown by SpringVersion.getVersion, > b) the property files with custom mappings are not found. -- 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