Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357315 - PlatformServletContext should check if directory returned by servletContext.getRealPath() actually exists, not just if it's non-null
Summary: PlatformServletContext should check if directory returned by servletContext.g...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.5.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Hao Zhou CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-10 19:25 EDT by Michael Vorburger CLA
Modified: 2011-11-09 21:31 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.