Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 29880 invoked from network); 18 Jun 2009 11:27:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jun 2009 11:27:22 -0000 Received: (qmail 52529 invoked by uid 500); 18 Jun 2009 11:27:32 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 52383 invoked by uid 500); 18 Jun 2009 11:27:31 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 52364 invoked by uid 99); 18 Jun 2009 11:27:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 11:27:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 11:27:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 57729234C044 for ; Thu, 18 Jun 2009 04:27:07 -0700 (PDT) Message-ID: <1376286812.1245324427344.JavaMail.jira@brutus> Date: Thu, 18 Jun 2009 04:27:07 -0700 (PDT) From: "Thomas Diesler (JIRA)" To: dev@felix.apache.org Subject: [jira] Commented: (FELIX-1124) ResourceNotFoundException too verbose In-Reply-To: <1846742063.1241592990696.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FELIX-1124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721201#action_12721201 ] Thomas Diesler commented on FELIX-1124: --------------------------------------- Yes, this should be place. I verified this with framework-1.8.0 Here a sample stacktrace 2009-06-18 13:19:45,074 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration org.apache.felix.moduleloader.ResourceNotFoundException: META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:622) at org.apache.felix.framework.searchpolicy.ModuleImpl.getResourceByDelegation(ModuleImpl.java:488) at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.getResource(ModuleImpl.java:1631) at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1168) > ResourceNotFoundException too verbose > ------------------------------------- > > Key: FELIX-1124 > URL: https://issues.apache.org/jira/browse/FELIX-1124 > Project: Felix > Issue Type: Bug > Components: Framework > Affects Versions: felix-1.6.1, felix-1.8.0 > Reporter: Thomas Diesler > > ModuleImpl logs stack traces for every resource that cannot be found. Often resources are optional or may be located at different locations. > public URL getResourceByDelegation(String name) > { > try > { > return (URL) findClassOrResourceByDelegation(name, false); > } > catch (ClassNotFoundException ex) > { > // This should never be thrown because we are loading resources. > } > catch (ResourceNotFoundException ex) > { > m_logger.log( > Logger.LOG_DEBUG, > ex.getMessage(), > ex); > } > return null; > } > Please consider a log message without stack trace and leave it to the client to be more verbose when appropriate. > To log no message at all and simply return null would also be consistent with > http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.