Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 74017 invoked from network); 8 Jun 2007 14:27:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jun 2007 14:27:52 -0000 Received: (qmail 55384 invoked by uid 500); 8 Jun 2007 14:27:51 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 55309 invoked by uid 500); 8 Jun 2007 14:27:51 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 55279 invoked by uid 99); 8 Jun 2007 14:27:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2007 07:27:51 -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; Fri, 08 Jun 2007 07:27:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B220E7141ED for ; Fri, 8 Jun 2007 07:27:26 -0700 (PDT) Message-ID: <8878599.1181312846727.JavaMail.jira@brutus> Date: Fri, 8 Jun 2007 07:27:26 -0700 (PDT) From: "Davanum Srinivas (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-2679) DeploymentClassloader unable to access resources from parent classloader In-Reply-To: <24226767.1179354616126.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/AXIS2-2679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502824 ] Davanum Srinivas commented on AXIS2-2679: ----------------------------------------- fixed in svn revision 545518 > DeploymentClassloader unable to access resources from parent classloader > ------------------------------------------------------------------------ > > Key: AXIS2-2679 > URL: https://issues.apache.org/jira/browse/AXIS2-2679 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Components: kernel > Affects Versions: 1.2 > Reporter: Alex Gitelman > Assignee: Deepal Jayasinghe > > The following code does not work: > AxisService serv = > _log.debug("DEPLOYED SERVICE: " + serv.getName()); > _log.info("************* SPRING LOAD *****************"); > ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext( > new String[] { "/META-INF/spring/web-components.xml" }, > false, > parentContext); > appContext.setClassLoader(serv.getClassLoader()); > appContext.refresh(); > It complains about missing schemas (since web-components.xml is using spring schemas). > I tracked the problem down to Axis2 DeploymentClassloader and discovered that this classloader would not load any resource that is located in the parent classloader dues to the following code: > public InputStream getResourceAsStream(String name) { > URL url =findResource(name); > if(url!=null){ > try { > return url.openStream(); > } catch (IOException e) { > throw new RuntimeException(e); > } > } > return null; > } > Acoording to J2SE API spec (in my interpretaion), first line should be > URL url =getResource(name); and not URL url =findResource(name); > Changing findResource to getResource - fixes the problem. > Formal diff: > ==== modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java#1 - modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java ====252c252 > < URL url =findResource(name); > --- > > URL url =getResource(name); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org