Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB31110CDA for ; Fri, 2 Aug 2013 11:08:39 +0000 (UTC) Received: (qmail 87567 invoked by uid 500); 2 Aug 2013 11:08:35 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 87517 invoked by uid 500); 2 Aug 2013 11:08:33 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 87496 invoked by uid 99); 2 Aug 2013 11:08:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Aug 2013 11:08:32 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: encountered temporary error during SPF processing of domain of ognjen.d.blagojevic@gmail.com) Received: from [147.91.1.120] (HELO afrodita.rcub.bg.ac.rs) (147.91.1.120) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Aug 2013 11:08:27 +0000 Received: from [IPv6:2001:4170:0:4::66] (unknown [IPv6:2001:4170:0:4::66]) by afrodita.rcub.bg.ac.rs (Postfix) with ESMTP id EB317191A956 for ; Fri, 2 Aug 2013 13:07:41 +0200 (CEST) Message-ID: <51FB92FE.4050408@gmail.com> Date: Fri, 02 Aug 2013 13:07:42 +0200 From: Ognjen Blagojevic User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tomcat Users List Subject: Problem with getRealPath("") on Tomcat 8 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-RCUB-MailScanner-Information: Please contact the ISP for more information X-RCUB-MailScanner-ID: EB317191A956.AB1DF X-RCUB-MailScanner: Found to be clean X-RCUB-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.6, required 6, autolearn=not spam, BAYES_00 -2.60, NO_RELAYS -0.00) X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am just testing Tomcat 8.0.0-RC1 that is proposed for (Alpha) release. I noticed that (unlike Tomcat 7.0.42) this version throws IllegalArgumentException upon calling ServletContext.getRealPath(""). It seems that TC8 expects that argument provided to getRealPath is non-empty string. The code that tries to execute getRealPath with empty argument is not mine, it is from Apache Axis2 1.6.2 (latest production release). Now, I could file a bug with Axis2, but I am actually not sure is it really necessary that getRealPath argument is non-empty string? -Ognjen P.S. More details below. Stack trace: [ERROR] java.lang.IllegalArgumentException java.lang.IllegalArgumentException at org.apache.catalina.webresources.AbstractResourceSet.checkPath(AbstractResourceSet.java:39) at org.apache.catalina.webresources.DirResourceSet.getResource(DirResourceSet.java:91) at org.apache.catalina.webresources.StandardRoot.getResourceInternal(StandardRoot.java:176) at org.apache.catalina.webresources.CachedResource.validate(CachedResource.java:62) at org.apache.catalina.webresources.Cache.getResource(Cache.java:78) at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:163) at org.apache.catalina.core.StandardContext.getRealPath(StandardContext.java:4528) at org.apache.catalina.core.ApplicationContext.getRealPath(ApplicationContext.java:398) at org.apache.catalina.core.ApplicationContextFacade.getRealPath(ApplicationContextFacade.java:335) at org.apache.axis2.deployment.WarBasedAxisConfigurator.(WarBasedAxisConfigurator.java:103) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1235) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1044) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5025) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:968) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1742) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) ------------------------------ Axis2 code (WarBasedAxisConfigurator.java:103-106): 103: String webpath = config.getServletContext().getRealPath(""); 104: if (webpath == null || webpath.length() == 0) { 105: webpath = config.getServletContext().getRealPath("/"); 106: } ------------------------------ Tomcat 8 code throwing the exception (AbstractResourceSet.java:37-41): protected final void checkPath(String path) { if (path == null || path.length() == 0 || path.charAt(0) != '/') { throw new IllegalArgumentException(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org