Project: Tomcat
Bug 55345 Webresources class AbstractResourceSet throws exception upon callong ServletContext.getRealPath("")
Reported: 2013-08-02 11:52:04 | Status: closed fixed

As described on user list: Tomcat 8, unlike Tomcat 7.0.42, throws IllegalArgumentException upon calling ServletContext.getRealPath(""). It seems that TC8 expects that argument provided to getRealPath is non-empty string. I believe that ServletContext.getRealPath should allow empty string as argument. -Ognjen 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.<init>(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)

Files changed in fix:
java/org/apache/catalina/core/StandardContext.java