class WebappClassLoaderTransformer {

    protected static AgentLogger LOGGER = AgentLogger.getLogger(WebappClassLoaderTransformer.class);

    private static boolean webappClassLoaderPatched = false;

    @OnClassLoadEvent(classNameRegexp = "org.glassfish.web.loader.WebappClassLoader")
    public static void patchWebappClassLoader(ClassPool classPool,CtClass ctClass) throws CannotCompileException, NotFoundException {<FILL_FUNCTION_BODY>}

}

        if (!webappClassLoaderPatched) {
            try {
                // clear classloader cache
                ctClass.getDeclaredMethod("getResource", new CtClass[]{classPool.get("java.lang.String")}).insertBefore(
                        "resourceEntries.clear();"
                );
                ctClass.getDeclaredMethod("getResourceAsStream", new CtClass[]{classPool.get("java.lang.String")}).insertBefore(
                        "resourceEntries.clear();"
                );
                webappClassLoaderPatched = true;
            } catch (NotFoundException e) {
                LOGGER.trace("WebappClassLoader does not contain getResource(), getResourceAsStream method.");
            }
        }
    
<no_super_class>