Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 64339 invoked from network); 14 Apr 2006 21:29:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Apr 2006 21:29:29 -0000 Received: (qmail 39448 invoked by uid 500); 14 Apr 2006 21:29:27 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 39259 invoked by uid 500); 14 Apr 2006 21:29:26 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 39248 invoked by uid 99); 14 Apr 2006 21:29:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2006 14:29:26 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME 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; Fri, 14 Apr 2006 14:29:26 -0700 Received: by brutus.apache.org (Postfix, from userid 33) id 739E171429F; Fri, 14 Apr 2006 21:28:33 +0000 (GMT) From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 39168] New: - [configuration] ConfigurationUtils.locate throws NullPointerException if the context ClassLoader is null Message-ID: X-Bugzilla-Reason: AssignedTo Date: Fri, 14 Apr 2006 21:28:33 +0000 (GMT) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=39168 Summary: [configuration] ConfigurationUtils.locate throws NullPointerException if the context ClassLoader is null Product: Commons Version: 1.2 Final Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Configuration AssignedTo: commons-dev@jakarta.apache.org ReportedBy: nomus@yandex.ru Hello, When the locate method attempts to find resource location from the context classpath (lines 375-384 in ConfigurationUtils.java) it fails (on line 378) if the context ClassLoader cannot be retrieved for the current thread. I suppose this bug is quite difficult to reproduce. I came accross it when I and a colleague of mine were testing a Java API (kept in one jar) that is called from C++ application. In the static initializer of a Java class I used the next line to load settings: config = new PropertiesConfiguration(ConfigurationUtils.locate("properties/routing. properties")); It worked fine if the class was used from another Java class that was normally loaded by JVM (for example my tests passed). But when my Java classes were executed by JVM started from C++ application it resulted in the next exception: java.lang.NullPointerException at org.apache.commons.configuration.ConfigurationUtils. locate(ConfigurationUtils.java:378) at org.apache.commons.configuration.ConfigurationUtils. locate(ConfigurationUtils.java:255) ... It is obvious from the ConfigurationUtils code that loader variable got null value (line 377) for some reason so the next step threw the exception. I suppose this bug can be easily fixed (just to add an additional check if loader is not null). As a workaround I will try to call locate method with a given base parameter (but it needs to determine location of my jar so it is a kind of overheads though it would work I hope). Sorry for my English. Hope it is useful, Denis -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org