Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 51918 invoked from network); 21 Apr 2008 08:15:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Apr 2008 08:15:42 -0000 Received: (qmail 45718 invoked by uid 500); 21 Apr 2008 08:15:41 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 45675 invoked by uid 500); 21 Apr 2008 08:15:41 -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 45664 invoked by uid 99); 21 Apr 2008 08:15:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Apr 2008 01:15:40 -0700 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; Mon, 21 Apr 2008 08:15:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7F666234C0E6 for ; Mon, 21 Apr 2008 01:12:21 -0700 (PDT) Message-ID: <507687388.1208765541507.JavaMail.jira@brutus> Date: Mon, 21 Apr 2008 01:12:21 -0700 (PDT) From: "Mikkel T. Jensen (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Created: (AXIS2-3756) Issue loading module when classpath is on a network MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Issue loading module when classpath is on a network --------------------------------------------------- Key: AXIS2-3756 URL: https://issues.apache.org/jira/browse/AXIS2-3756 Project: Axis 2.0 (Axis2) Issue Type: Bug Components: kernel Affects Versions: 1.3 Environment: Windows XP, Windows Server 2003 Reporter: Mikkel T. Jensen When the classpath of a client application is setup to point to a network (e.g. \\servername\share\domain_classpath, for instance in a cluster of application servers), axis2 fails to engage modules on the classpath with an AxisFault with the message "Unable to engage module". The problem is located in the class org.apache.axis2.deployment.RepositoryListener in the method loadClassPathModules(): protected void loadClassPathModules() { ModuleDeployer deployer = deploymentEngine.getModuleDeployer(); // Find Modules on the class path (i.e. if classpath includes "addressing.mar" then // addressing will be available for engaging) ClassLoader loader = Thread.currentThread().getContextClassLoader(); try { Enumeration moduleURLs = loader.getResources("META-INF/module.xml"); while (moduleURLs.hasMoreElements()) { try { URL url = (URL)moduleURLs.nextElement(); String fileName = url.toString(); if (fileName.startsWith("jar")) { url = ((java.net.JarURLConnection) url.openConnection()).getJarFileURL(); fileName = url.toString(); File f = new File(new URI(fileName)); addFileToDeploy(f, deployer ,WSInfo.TYPE_MODULE); } else if (fileName.startsWith("file")) { fileName = fileName.substring(0, fileName.lastIndexOf("/META-INF/module.xml")); File f = new File(new URI(fileName)); // *** IllegalArgumentException thrown here! addFileToDeploy(f, deployer ,WSInfo.TYPE_MODULE); } } catch (URISyntaxException e) { log.info(e); } } } catch (Exception e) { // Oh well, log the problem log.debug(e); } // rest of method omitted. The method finds all the module.xml files on the classpath and creates a File object for each of them. The use of the File class assumes that the classloader is not a network classloader. However, If the classpath is set up as mentioned above, the URI created will contain an authority part, and an IllegalArgumentException is thrown in the line marked *** above. To make things worse, the loop is terminated by the exception, which is debugged to a log (meaning it is lost in my system, and probably most others). Possible solutions: As a minimum, error handling should be improved to make it easier to locate this problem when it happens. The use of File instances to load the module.xml files should eliminated (replaced by InputStreams?) to make module loading robust to classloaders working over a network. -- 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