Spring官方API中对其描述如下

/**
* Listener that flushes the JDK's {@link java.beans.Introspector JavaBeans Introspector}
* cache on web app shutdown. Register this listener in your <code>web.xml</code> to
* guarantee proper release of the web application class loader and its loaded classes.
*
* <p><b>If the JavaBeans Introspector has been used to analyze application classes,
* the system-level Introspector cache will hold a hard reference to those classes.
* Consequently, those classes and the web application class loader will not be
* garbage-collected on web app shutdown!</b> This listener performs proper cleanup,
* to allow for garbage collection to take effect.
*
* <p>Unfortunately, the only way to clean up the Introspector is to flush
* the entire cache, as there is no way to specifically determine the
* application's classes referenced there. This will remove cached
* introspection results for all other applications in the server too.
*
* <p>Note that this listener is <i>not</i> necessary when using Spring's beans
* infrastructure within the application, as Spring's own introspection results
* cache will immediately flush an analyzed class from the JavaBeans Introspector
* cache and only hold a cache within the application's own ClassLoader.
*
* <b>Although Spring itself does not create JDK Introspector leaks, note that this
* listener should nevertheless be used in scenarios where the Spring framework classes
* themselves reside in a 'common' ClassLoader (such as the system ClassLoader).</b>
* In such a scenario, this listener will properly clean up Spring's introspection cache.
*
* <p>Application classes hardly ever need to use the JavaBeans Introspector
* directly, so are normally not the cause of Introspector resource leaks.
* Rather, many libraries and frameworks do not clean up the Introspector:
* e.g. Struts and Quartz.
*
* <p>Note that a single such Introspector leak will cause the entire web
* app class loader to not get garbage collected! This has the consequence that
* you will see all the application's static class resources (like singletons)
* around after web app shutdown, which is not the fault of those classes!
*
* <p><b>This listener should be registered as the first one in <code>web.xml</code>,
* before any application listeners such as Spring's ContextLoaderListener.</b>
* This allows the listener to take full effect at the right time of the lifecycle.
*
* @author Juergen Hoeller
* @since 1.1
* @see java.beans.Introspector#flushCaches()
* @see org.springframework.beans.CachedIntrospectionResults#acceptClassLoader
* @see org.springframework.beans.CachedIntrospectionResults#clearClassLoader
*/

翻译过来大致就是下面的意思

/**
* org.springframework.web.util.IntrospectorCleanupListener的用途
* @see -------------------------------------------------------------------------------------------------------------------
* @see 此监听器出用于主要为了解决java.beans.Introspector导致内存泄漏的问题
* @see 此监听器应该配置在web.xml中与Spring相关监听器中的第一个位置(也要在ContextLoaderListener的前面)
* @see -------------------------------------------------------------------------------------------------------------------
* @see JDK中的java.beans.Introspector类的用途是发现Java类是否符合JavaBean规范
* @see 如果有的框架或程序用到了Introspector类,那么就会启用一个系统级别的缓存,此缓存会存放一些曾加载并分析过的JavaBean的引用
* @see 当Web服务器关闭时,由于此缓存中存放着这些JavaBean的引用,所以垃圾回收器无法回收Web容器中的JavaBean对象,最后导致内存变大
* @see 而org.springframework.web.util.IntrospectorCleanupListener就是专门用来处理Introspector内存泄漏问题的辅助类
* @see IntrospectorCleanupListener会在Web服务器停止时清理Introspector缓存,使那些Javabean能被垃圾回收器正确回收
* @see -------------------------------------------------------------------------------------------------------------------
* @see Spring自身不会出现这种问题
* @see 因为Spring在加载并分析完一个类之后会马上刷新JavaBeans Introspector缓存,这就保证Spring中不会出现这种内存泄漏的问题
* @see 但有些程序和框架在使用了JavaBeans Introspector之后,没有进行清理工作(如Quartz,Struts),最后导致内存泄漏
* @see -------------------------------------------------------------------------------------------------------------------
* @create Sep 24, 2013 9:10:09 PM
* @author 玄玉<http://blog.csdn.net/jadyer>
*/

org.springframework.web.util.IntrospectorCleanupListener的用途的更多相关文章

  1. java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener

    一:如果出现下面的错误信息,如果你的项目是Maven结构的,那么一般都是你的项目的Maven Dependencies没有添加到项目的编译路径下: 信息: The APR based Apache T ...

  2. Maven项目Eclipse启动时报错: java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener

    Eclipse中启动Maven项目时报如下错误: 严重: Error configuring application listener of class org.springframework.web ...

  3. gradle web项目启动报错: java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener

    严重: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanup ...

  4. 严重:Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener

    mave项目换了一个新的工作空间时出现的问题 原因: 其实是你的jar文件没有同步发布到自己项目的lib目录中(如果你是用Maven进行构建的话) 可以试试 下面的办法 解决方案: 项目点击右键 点击 ...

  5. 异常: java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener

    如果出现这个错误信息,如果你的项目是Maven结构的,那么一般都是你的项目的Maven Dependencies没有添加到项目的编译路径下 解决办法: ①选中项目->右键Properties-& ...

  6. org.springframework.web.util.IntrospectorCleanupListener作用

    回收那些不会主动回收,导致内存泄漏的垃圾,如javabeans

  7. maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

    环境:Groovy/Grails Tool Suite 3.1.0.RELEASE(BASED ON ECLIPSE JUNO 3.8.1).JDK1.6.Maven3.05.Tomcat6 错误描述 ...

  8. maven web启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

    问题描述 SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfi ...

  9. org.springframework.web.util.NestedServletException : Handler processing failed; nested exception is java.lang.StackOverflowError

    1 ,错误原因,循环冗余检查      result.setNearUsers(userList);            Page page = new Page();            pag ...

随机推荐

  1. Maven中pom.xml常用元素说明

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  2. JUnit4基础 使用JUnit4进行单元测试

    JUnit 4全面引入了Annotation来执行我们编写的测试. 关于JUnit 3的使用可以参见:http://www.cnblogs.com/mengdd/archive/2013/03/26/ ...

  3. mac下显示隐藏文件

    一.在终端中 ls -a就可以查看隐藏文件. 显示和隐藏的命令例如以下: 显示:defaults write com.apple.finder AppleShowAllFiles -bool true ...

  4. mbed OS - ARM关于物联网(IoT)的战略布局

    关于IoT 在刚刚过去的ARMTECHCON2014(Santa Clara Convention Center)第1天会议,首要的keynote就是ARM针对建立物联网(InternetOf Thi ...

  5. Dalvik虚拟机简要介绍和学习计划

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/8852432 我们知道,Android应用程序是 ...

  6. FileSystemWatcher使用方法具体解释

    FileSystemWatcher控件主要功能: 监控指定文件或文件夹的文件的创建.删除.修改.重命名等活动.能够动态地定义须要监控的文件类型及文件属性修改的类型. 1.经常使用的几个基本属性: (1 ...

  7. 面试前的准备---C#知识点回顾----05

    技术博客还得继续写,工作还在筛选,学习还得继续 1.Session和Cookie的使用区别 很容易回答的就是Session在服务器端,存储的数据可以较大容量,比如我们存一个Table,上千条数据. C ...

  8. 线程:CountDownLatch同步工具

    一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个线程一直等待. 类似计数器,当计数器的值为0时,继续往下执行. package ch03; import java.util.R ...

  9. 我的第一个QML Button的实现

    编写第一个QML,在成功跑完HelloWorld后,决定自己实现Button按钮类. Button是在Quick2版本以上的QtQuick Controls出现的. 在Qt5.5.1版本中,选择插入Q ...

  10. Android 开发技术流程

    1.网络连接通信 HttpClient 类通信(见<第一行代码> 郭霖2014.8月第一版P385) Android Asynchronous Http Client  (见  http: ...