3 Replies Latest reply on Jan 13, 2006 4:49 AM by haschibaschi

    Clearing the class loader repository through the jmx console

    balteo

      Hello,
      Is it possible to clear the class loader repository through the jmx console. I tried to invoke the flush operation and it does not clear the class loader repository.
      Any help welcome,
      Julien.

        • 1. Re: Clearing the class loader repository through the jmx con
          dimitris

          The subject is quite complex, so your best take is to just redeploy your application. There is no explicit way in java to completely get rid of a loaded class. It will only be garbage collected when all references to it are gone, and you usually have no control over this.

          • 2. Re: Clearing the class loader repository through the jmx con
            balteo

            Thanks for the reply Dimitris...

            • 3. Re: Clearing the class loader repository through the jmx con

              I have an ear with several jars (normal and EJB) and wars inside.
              When I redeploy a jar and flush the Repository, there are still the old classes loaded. This is like you described above that you have no control over the classloading inside the jvm.

              But is there no way to cut all references to the loaded classes from the ear, that all the loaded classes would be garbage-collected and the redeployed would be loaded?

              When I redeploy the whole ear, then the old classes are no more loaded an by a call to the classes the new ones would be loaded. What happens by this scenario? Are there no ways to force this whitout a redeploy of the whole ear?