Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357315

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: BIRTAssignee: 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:

Description Michael Vorburger CLA 2011-09-10 19:25:52 EDT
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.
Comment 1 Michael Vorburger CLA 2011-09-10 19:41:44 EDT
FYI: https://issues.apache.org/bugzilla/show_bug.cgi?id=51799 raised on Tomcat.
Comment 2 Yu Chen CLA 2011-10-30 23:31:49 EDT
Applied the patch.