Wicket
  1. Wicket
  2. WICKET-625

Wicket doesn't clean up properly when hot-deploying; hangs onto Class references.

    Details

      Description

      When you undeploy a webapp, ideally it should go away and its WebAppClassLoader should be garbage collected. There are various reasons this won't happen, but they essentially split into two problems:

      1) The App Server has references to classes in the WebAppClassLoader in its own objects (on Tomcat these are typically commons logging statics in StandardContext in catalina, or some of the jakarta code). There's not much you can do about this, short of getting a better app server.

      2) You hold references to Class objects loaded by your WebAppClassLoader in static fields in other Classes loaded by your WebAppClassLoader.

      Number 2 can be solved by the use of WeakReferences to the Class objects.

      Note that you also need to be careful about classes that have Class references internally, such as java.lang.reflect.Method and Field. You can also hold these items in a WeakReference, but they have the potential to be garbage collected randomly, unlike the underlying Class objects.

      I have some patches that allow me to start up and shut down a Spring-backed Wicket-based app and have the classloader cope properly. They could probably do with some review.

      1. WICKET-625.patch
        55 kB
        Alastair Maw

        Activity

        Alastair Maw created issue -
        Alastair Maw made changes -
        Field Original Value New Value
        Attachment WICKET-625.patch [ 12359197 ]
        Eelco Hillenius made changes -
        Fix Version/s 1.3.0-beta5 [ 12312818 ]
        Alastair Maw made changes -
        Fix Version/s 1.3.1 [ 12312500 ]
        Fix Version/s 1.3.0-beta5 [ 12312818 ]
        Frank Bille Jensen made changes -
        Fix Version/s 1.3.2 [ 12312942 ]
        Fix Version/s 1.3.1 [ 12312500 ]
        Frank Bille Jensen made changes -
        Fix Version/s 1.3.2 [ 12312942 ]
        Fix Version/s 1.3.3 [ 12313047 ]
        Frank Bille Jensen made changes -
        Fix Version/s 1.3.3 [ 12313047 ]
        Fix Version/s 1.3.4 [ 12313089 ]
        Martijn Dashorst made changes -
        Fix Version/s 1.3.4 [ 12313089 ]
        Fix Version/s 1.3.5 [ 12313175 ]
        Igor Vaynberg made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Juergen Donnerstag made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Alastair Maw [ almaw ]
        Juergen Donnerstag made changes -
        Fix Version/s 1.3.5 [ 12313175 ]
        Affects Version/s 1.4.0 [ 12314093 ]
        Igor Vaynberg made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Igor Vaynberg [ ivaynberg ]
        Fix Version/s 1.4.4 [ 12314323 ]
        Fix Version/s 1.5-M1 [ 12313078 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Alastair Maw
          • Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development