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 2005/09/29 19:05:14 UTC

DO NOT REPLY [Bug 36852] - Custom Webapp loaders don't correctly honor context's privileged="true" attribute

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=36852>.
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=36852





------- Additional Comments From junk.brinkley@gmail.com  2005-09-29 19:05 -------
Here is a suggested fix, which appears to fix the problem in my environment. It
is in the method CreateLoaderRule.begin() ... my changes are flanked with the
comment //NEW:mdb:

    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {

        // Look up the required parent class loader
        ClassLoader parentClassLoader = null;
        Object ojb = digester.peek();
        if (ojb instanceof Container) {
            parentClassLoader = ((Container)ojb).getParentClassLoader();
        }

        //NEW:mdb: if the context is priviledged, set the classloader to
        // the context's classloader...
        if( ojb instanceof org.apache.catalina.Context &&
            ((org.apache.catalina.Context)ojb).getPrivileged() )
        {
            parentClassLoader = ojb.getClass().getClassLoader();
        }
        //NEW:mdb:end change to test for privileged flag...


-- 
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org