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

Bug 329566

Summary: HttpServletRequest.getRealPath() broken in Virgo
Product: [RT] Gemini.Web Reporter: Ellen Strnod <estrnod>
Component: unknownAssignee: Chris Frost <eclipse>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: eclipse, estrnod, glyn.normington, milesg78
Version: 1.1.0.RELEASE   
Target Milestone: 1.2.0.M02   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 329982    
Attachments:
Description Flags
Project, build of example case illustrating the issue (including built bundle in target)
none
patch proposal eclipse: iplog+

Description Ellen Strnod CLA 2010-11-05 13:07:15 EDT
Build Identifier: 2.1.0-RELEASE

HttpServletRequest.getRealPath() returns null when running under Virgo 2.1.0-RELEASE; returned an absolute path in dm server 2.0.0-RELEASE.

Reproducible: Always
Comment 1 Ellen Strnod CLA 2010-11-05 13:09:33 EDT
Created attachment 182500 [details]
Project, build of example case illustrating the issue (including built bundle in target)

Attached is an Eclipse & maven2 test project, already built. Deploy and hit it with http://localhost/testbundle in the browser, then look at results in log file (or on console in 2.1.0).

2.0.0-RELEASE results:
2010-11-05 09:48:42.511|http-80-1|DEBUG|com.annealsoft.test.TestServlet .doGet:15|************** REAL PATH: C:\Insight\dmserver\work\osgi\configuration\org.eclipse.osgi \bundles\38\data\store\org.eclipse.osgi\bundles\99\1\bundlef ile\.

2.1.0-RELEASE results:
09:41:07.333|http-80-1|DEBUG|com.annealsoft.test.TestServlet .doGet:15|************** REAL PATH: null
Comment 2 Glyn Normington CLA 2010-11-05 13:39:24 EDT
Thanks for raising this bug and providing the testcase!
Comment 3 Ellen Strnod CLA 2010-11-08 12:49:46 EST
A workaround - I don't know what this returns in 2.0.0, but getRealPath() in dm server 2.1.0 returns null for "." but a correct real path for "/".
Comment 4 Violeta Georgieva CLA 2010-11-11 04:30:10 EST
Created attachment 182887 [details]
patch proposal

Hi Glyn,

I want to propose a patch for this issue.
I'm looking forward to your comments.

Regards
Violeta
Comment 5 Glyn Normington CLA 2010-11-11 05:00:08 EST
Thanks Violeta!

The patch looks good to me and is very unlikely to regress the fix that introduced this bug (the ability to supply web.xml in a fragment). I have recorded bug 329979 to add a suitable integration test, but this is not urgent and is not really related to this fix.

There are no new files in the patch, so please would you confirm you wrote 100% of the code and have the right to donate it to Eclipse.

Assigning to Chris for integration into Gemini Web. (Chris: I've asked the necessary IP question above. Please don't push the commit until Violeta confirms. Also, please ensure Violeta is the author of the commit.)
Comment 6 Glyn Normington CLA 2010-11-11 05:01:36 EST
Changing the product to Gemini Web as that is where the bug and the fix reside.
Comment 7 Glyn Normington CLA 2010-11-11 05:06:33 EST
Setting target Gemini Web milestone.
Comment 8 Violeta Georgieva CLA 2010-11-11 05:40:06 EST
(In reply to comment #7)
> Setting target Gemini Web milestone.

I confirm that I wrote 100% of the code and I have the right to donate it to Eclipse.
Comment 9 Chris Frost CLA 2010-11-11 10:41:37 EST
Thanks for patch. I have applied it to gemini web, all the tests passed and I have pushed.
Comment 10 Chris Frost CLA 2010-11-11 11:07:47 EST
Done