Struts2测试程序报错解决实例(2)

Class cl = loader.getClass();
    try
    {
      if ("org.apache.catalina.loader.WebappClassLoader".equals(cl.getName())) {
        clearMap(cl, loader, "resourceEntries");
      }
      else if (LOG.isDebugEnabled())
        LOG.debug("class loader " + cl.getName() + " is not tomcat loader.", new String[0]);
    }
    catch (NoSuchFieldException nsfe)
    {
      if ("org.apache.catalina.loader.WebappClassLoaderBase".equals(cl.getSuperclass().getName())) {
        if (LOG.isDebugEnabled())
          LOG.debug("Base class #0 doesn't contain '#1' field, trying with parent!", nsfe, new String[] { cl.getName(), "resourceEntries" });
        try
        {
          clearMap(cl.getSuperclass(), loader, "resourceEntries");
        } catch (Exception e) {
          if (LOG.isWarnEnabled())
            LOG.warn("Couldn't clear tomcat cache using #0", e, new String[] { cl.getSuperclass().getName() });
        }
      }
    }
    catch (Exception e) {
      if (LOG.isWarnEnabled())
        LOG.warn("Couldn't clear tomcat cache", e, new String[] { cl.getName() });
    }
  }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/408c4cb98d7cf0dd42b210f3d14337ad.html