tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45963] New: WebappClassLoader.loadClass() throws NoClassDefFoundError from system.loadClass()
Date Tue, 07 Oct 2008 21:41:15 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45963

           Summary: WebappClassLoader.loadClass() throws
                    NoClassDefFoundError from system.loadClass()
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: SunOS
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: drmacdon@hotmail.com


WebappClassLoader.java line 1302 performs a system.loadClass(name) and catches
the corresponding ClassNotFoundException. 

If system is able to find a class but not all necessary dependents, the code
breaks past the catch with a NoClassDefFoundError during the defineClass() call
and fails while my class loader would have resolved everything had it been
given the chance.

Ignoring NoClassDefFoundError's would be nice - although cleaning up my
layering will help avoid the issue as well. 


        // (0.2) Try loading the class with the system class loader, to prevent
        //       the webapp from overriding J2SE classes
        try {
            clazz = system.loadClass(name);
            if (clazz != null) {
                if (resolve)
                    resolveClass(clazz);
                return (clazz);
            }
        } catch (ClassNotFoundException e) {
            // Ignore
        }


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

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


Mime
View raw message