Uploaded image for project: 'XBean'
  1. XBean
  2. XBEAN-95

register PropertyEditors locally, not globally

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • spring
    • None

    Description

      org.apache.xbean.spring.context.impl.PropertyEditorHelper registers PropertyEditors for java.io.File, java.net.URI, java.util.Date and javax.management.ObjectName using java.beans.PropertyEditorManager.registerEditor(). This may cause problems:

      • the usual problem with global variables: another application running in the same JVM may register a different PropertyEditor, e.g. for java.util.Date. One of the applications will then use the PropertyEditor that was registered by the other application. Which application 'wins' depends on the order of the calls to PropertyEditorManager.registerEditor().
      • java.beans.PropertyEditorManager keeps a strong reference to the registered classes. The xbean PropertyEditor classes are loaded by the context class loader, (which is the webapp class loader if running in Tomcat etc.). The class java.beans.PropertyEditorManager is loaded by the bootstrap class loader. This means that there is a strong reference from the bootstrap class loader to the webapp class loader, which means that the webapp class loader cannot be unloaded, which means that the webapp is not garbage collected when it is undeployed.

      Attachments

        Activity

          People

            dain Dain Sundstrom
            jcsahnwaldt Christopher Sahnwaldt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: