6 Replies Latest reply on Mar 15, 2005 5:51 PM by starksm64

    removeClassLoader operation in jmx console

    balteo

      Hello,
      I would like to invoke the removeClassLoader operation in the jmx console (LoaderRepository service). I do not know what to pass as an argument. I tried com.mycompany.MyLibrary and I get this:

      HTTP Status 500 -
      
      type Exception report
      message
      description The server encountered an internal error () that prevented it from fulfilling this request.
      exception
      javax.servlet.ServletException: Failed to invoke operation
       org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:248)
       org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:79)
       org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      root cause
      javax.management.IntrospectionException: Failed to find PropertyEditor for type: java.lang.ClassLoader
       org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:230)
       org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:202)
       org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:241)
       org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:79)
       org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
      
      Apache Tomcat/5.0.28
      



      Can anyone help?

      Thanks in advance,

      Julien Martin.

        • 1. Re: removeClassLoader operation in jmx console
          dimitris

          This doesn't seem like a method that you can remotely call...

          • 2. Re: removeClassLoader operation in jmx console
            balteo

            Thanks for the reply Dimitris,
            Is there a surefire way to know which method one can invoke in the jmx console?
            Julien.

            • 3. Re: removeClassLoader operation in jmx console
              dimitris

              Not really. The jmx-console is generic but at the same time "dumb" because it just uses the metadata from each MBean in order to present the exposed attributes and operations.

              What each operation does, whether its parameters are serializable or not, or what each attribute means, is really something defined by the MBean writer, and we know that in jboss everyone can write and extend jboss with her own mbeans. There is no formal way to know this info.

              So each MBean writer should have a section in her own documentation providing this information. This is often the case with the various jboss subsystems (e.g. JCA will let you know what are the related MBeans and what each attribute means, give or take :)

              What we don't have, is a comprehensive list of things of interest for the jboss administrator.

              The new jboss admin console which is under development will offer a more "administrative" and functional view to the multitude of functionalities available with jboss.

              Hope that helps :)

              • 4. Re: removeClassLoader operation in jmx console
                balteo

                Thanks for the detailed reply.
                Julien :-)

                • 5. Re: removeClassLoader operation in jmx console
                  genman


                  You could create your own MBean (that's perhaps remotely accessible or not) that, given a String, calls the JBoss MBean for you.

                  • 6. Re: removeClassLoader operation in jmx console
                    starksm64

                    Removal of a class loader from the ULR is not supported from the jmx-console, remotely in general, and is a questionable thing to do as you are essentially fracturing the type system associated with the removed class loader. Every class loaded by that class loader remains bound to it as long as there are references to the classes or class loader itself. Recycling of classes needs to be done via redeployment.