| Summary: | PlatformServletContext should check if directory returned by servletContext.getRealPath() actually exists, not just if it's non-null | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Michael Vorburger <mike> |
| Component: | BIRT | Assignee: | Birt-ReportEngine-inbox <Birt-ReportEngine-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | Hao Zhou <hao.zhou> |
| Severity: | normal | ||
| Priority: | P3 | CC: | bluesoldier, yChen |
| Version: | 2.5.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
FYI: https://issues.apache.org/bugzilla/show_bug.cgi?id=51799 raised on Tomcat. Applied the patch. |
The servletContext.getRealPath() API behaves inconsistently in different Servlet Containers; I have found that because Jetty 7.3.0 returns null for servletContext.getRealPath("/WEB-INF/platform/") while Tomcat 7.0.21 returns where this "would have been" (e.g. something like /home/vorburger/bin/apache-tomcat-7.0.21/webapps/mifos/WEB-INF/platform - even if there is nothing there). BIRT in its PlatformServletContext is capable of "deploying" (extracting to a temporary dir) the OSGi Platform - but does that only if the Servlet Container returns null from getRealPath(). It would thus be better if http://dev.eclipse.org/viewcvs/viewvc.cgi/source/org.eclipse.birt.core/src/org/eclipse/birt/core/framework/PlatformServletContext.java?view=co&revision=1.15&root=BIRT_Project&pathrev=BIRT_2_5_0_Branch in reporting/src/main/java/org/eclipse/birt/core/framework/PlatformServletContext.java changed line 88 of PlatformServletContext from if ( platform == null ) to if ( platform == null || !new File(platform).exists()) Please see http://mifosforge.jira.com/browse/MIFOS-5118 for more background.