You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/06/13 08:38:50 UTC

DO NOT REPLY [Bug 39794] New: - getResource method of WebappClassLoader does not return URLs for packages

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39794>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39794

           Summary: getResource method of WebappClassLoader does not return
                    URLs for packages
           Product: Tomcat 5
           Version: 5.0.30
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mjesseni@edu.uni-klu.ac.at


In my application scenario I need to be able to find all resources located 
within a given package. Therefore, I use the getResource method to find first 
the package along the classpath and afterwards I list all resources located 
within this package. I need this functionality to find all available Hibernate 
mapping documents so that I can dynamically configure Hibernate and dont need 
to know exact names of mapping documents. However, the WebappClassLoader does 
not return URLs for packages. For example

Thread.currentThread().getContextClassLoader().getResource("path/to/package");

returns null. The workaround for this issue is to place a resource with a 
fixed name in this package, so that this resource can be found. From the 
returned URL I extract the directory and than list the resources within that 
directory. 

However, the getResource method of the JVM classloader implementation also 
returns URLs for packages so that this workaround is not needed I 'normal' 
java applications. I am not sure whether or not this is a bug of the webapp 
classloader implementation.

I use tomcat 5.0.30 and Java 1.5.0_07.

Kind regards
Markus jessenitschnig

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 39794] - getResource method of WebappClassLoader does not return URLs for packages

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39794>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39794


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From markt@apache.org  2006-06-14 01:44 -------
This works as you require in the latest 5.5.x code from svn.

I have had a quick look at the change log but can't see any obvious patch that
would have fixed this.

I am going to resolve this as fixed. If you particularly want this fixed in the
5.0.x branch feel free to re-open it but as far as I am aware there is unlikely
to be another 5.0.x release so it will get closed again as WONTFIX.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org