Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ServletContext.getRealPath() returns null

819863Nov 30 2010 — edited Nov 30 2010
I am using Sun Java System Web Server 7.0U8. I have a jsp page that relies on ServletContext.getRealPath(). This works fine, and returns the proper path that I would expect. However, if I add any <Client> tags inside of my myserver-obj.conf, ServletContext.getRealPath() suddenly returns null. It returns null if the <Client> tag matches or doesn't match the current request. Everything else, as far as I can tell, works fine. If I remove the <Client> tag, ServletContext.getRealPath() works properly again. The <Client> tag I am using is inside of <Object name="default">.

The client tag (url intentionally changed):

<Object name="default">
AuthTrans fn="match-browser" browser="\*MSIE*" ssl-unclean-shutdown="true"
<Client security="false">
NameTrans fn="redirect" from="/" url-prefix="https://XXX.YYY.com/"
</Client>
NameTrans fn="ntrans-j2ee" name="j2ee"
PathCheck fn="uri-clean"
PathCheck fn="check-acl" acl="default"
PathCheck fn="find-pathinfo"
PathCheck fn="find-index-j2ee"
PathCheck fn="find-index" index-names="index.jsp,index.htm,index.html"
ObjectType fn="type-j2ee"
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
ObjectType fn="shtml-hacktype"
Service fn="shtml-send" type="magnus-internal/parsed-html" method="(GET|HEAD)"
Service method="(GET|HEAD|POST)" type="\*~magnus-internal/*" fn="send-file"
Service method="TRACE" fn="service-trace"
Error fn="error-j2ee"
AddLog fn="flex-log"
</Object>

Both http and https are from the same virtual server, just different ports. Accessing it from the secure server, without the <Client> tag, works properly. With it, it fails.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 28 2010
Added on Nov 30 2010
2 comments
450 views