You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Forrest Xia (JIRA)" <ji...@apache.org> on 2010/06/25 15:45:49 UTC

[jira] Created: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null

In servlet, getServletConfig().getServletContext().getRealPath("/") return null
-------------------------------------------------------------------------------

                 Key: GERONIMO-5405
                 URL: https://issues.apache.org/jira/browse/GERONIMO-5405
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
    Affects Versions: 3.0-M1, 3.0
            Reporter: Forrest Xia


In the OSGi environment, no expanded web app directories in the geronimo repository, so we need a way to get the resource within jar/war/ear/car.

This bug causes daytrader app cannot initialize the database tables from the enclosed sql file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null

Posted by "Han Hong Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-5405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Han Hong Fang updated GERONIMO-5405:
------------------------------------

    Attachment: Geronimo-5405.patch

Patch for this problem is uploaded. Please help to review, thanks!

Here is the implementation details.  According to servlet 3.0 spec quoted below, in Geronimo, getRealPath() 

- return the unpacked location for the resources located in the META-INF/resources directory of the jar file
- for all other situation it returns null.

If same resources exist in different jar files, getRealPath() return the location once resource with specified name is found in one of the jar file.


P.S.

Servlet 3.0 Spec quotation:

"In situations where the servlet container cannot determine a valid file path for these
methods, such as when the Web application is executed from an archive, on a remote
file system not accessible locally, or in a database, these methods must return null.

Resources inside the META-INF/resources directory of JAR file must be
considered only if the container has unpacked them from their containing JAR file
when a call to getRealPath() is made, and in this case MUST return the unpacked
location."

> In servlet, getServletConfig().getServletContext().getRealPath("/") return null
> -------------------------------------------------------------------------------
>
>                 Key: GERONIMO-5405
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5405
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 3.0-M1, 3.0
>            Reporter: Forrest Xia
>            Assignee: Han Hong Fang
>         Attachments: Geronimo-5405.patch
>
>
> In the OSGi environment, no expanded web app directories in the geronimo repository, so we need a way to get the resource within jar/war/ear/car.
> This bug causes daytrader app cannot initialize the database tables from the enclosed sql file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null

Posted by "Han Hong Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-5405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895566#action_12895566 ] 

Han Hong Fang commented on GERONIMO-5405:
-----------------------------------------

I'd like to recap the discussion in tomcat mailing list (ref details here: http://tomcat.markmail.org/search/?q=getRealPath#query:getRealPath%20order%3Adate-backward+page:1+mid:magzax6enfqq7q6f+state:results)

In Geronimo, getRealPath() 

1. if the archive file of web application contains JAR file which has META-INF/resources directory, then getRealPath() returns the virtual path of the given rescource NO MATTER the given rescource exists or not
2. return null  in other situation

Based on this conclustion, the previous patch is invalid, meanwhile this JIRA is invalid as well. I suggest to close this JIRA.

> In servlet, getServletConfig().getServletContext().getRealPath("/") return null
> -------------------------------------------------------------------------------
>
>                 Key: GERONIMO-5405
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5405
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 3.0-M1, 3.0
>            Reporter: Forrest Xia
>            Assignee: Ivan
>         Attachments: Geronimo-5405.patch
>
>
> In the OSGi environment, no expanded web app directories in the geronimo repository, so we need a way to get the resource within jar/war/ear/car.
> This bug causes daytrader app cannot initialize the database tables from the enclosed sql file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-5405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan closed GERONIMO-5405.
--------------------------

    Resolution: Not A Problem

> In servlet, getServletConfig().getServletContext().getRealPath("/") return null
> -------------------------------------------------------------------------------
>
>                 Key: GERONIMO-5405
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5405
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 3.0-M1, 3.0
>            Reporter: Forrest Xia
>            Assignee: Ivan
>         Attachments: Geronimo-5405.patch
>
>
> In the OSGi environment, no expanded web app directories in the geronimo repository, so we need a way to get the resource within jar/war/ear/car.
> This bug causes daytrader app cannot initialize the database tables from the enclosed sql file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null

Posted by "Han Hong Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-5405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Han Hong Fang reassigned GERONIMO-5405:
---------------------------------------

    Assignee: Han Hong Fang

> In servlet, getServletConfig().getServletContext().getRealPath("/") return null
> -------------------------------------------------------------------------------
>
>                 Key: GERONIMO-5405
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5405
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 3.0-M1, 3.0
>            Reporter: Forrest Xia
>            Assignee: Han Hong Fang
>
> In the OSGi environment, no expanded web app directories in the geronimo repository, so we need a way to get the resource within jar/war/ear/car.
> This bug causes daytrader app cannot initialize the database tables from the enclosed sql file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-5405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan reassigned GERONIMO-5405:
------------------------------

    Assignee: Ivan  (was: Han Hong Fang)

> In servlet, getServletConfig().getServletContext().getRealPath("/") return null
> -------------------------------------------------------------------------------
>
>                 Key: GERONIMO-5405
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5405
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 3.0-M1, 3.0
>            Reporter: Forrest Xia
>            Assignee: Ivan
>         Attachments: Geronimo-5405.patch
>
>
> In the OSGi environment, no expanded web app directories in the geronimo repository, so we need a way to get the resource within jar/war/ear/car.
> This bug causes daytrader app cannot initialize the database tables from the enclosed sql file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.