3 Replies Latest reply on Apr 7, 2004 8:21 AM by Andrew Boyd

    ClassCastException when invoking MBean Operation JBoss 3.2.3

    Andrew Boyd Novice

      Hi All,
      I have a MBean that is deployed fine. It can be seen in the
      HTMLAdaptor but when I try to invoke the method loadData(String)
      I get the following exception:

      RuntimeMBeanException: RuntimeException in MBean operation 'loadData(java.lang.String)'
      Cause: java.lang.ClassCastException
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:299)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:234)
       at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:200)
      
      ... snip ...
      

      It doesn't seem like it is even getting to my code. I'm running 3.2.3
      my MBean looks like:
      public interface StaticLoaderMBean {
      
       public void loadData(String directory);
      }
      

      My class looks like:
      public class StaticLoader extends LocalAgent implements StaticLoaderMBean{
      
       FileLoader loader;
       String dir;
       long startTime;
       MessageProcessor msgProcessor;
      
       public void loadData(String directory){
       dir = directory;
       startTime = new GregorianCalendar().getTimeInMillis();
       //msgProcessor = new MyMessageProcessor();
       StaticLoaderThread thread = new StaticLoaderThread();
       thread.run();
       }
      
      


      When I call the method via webconsole or plain htmladaptor I enter
      c:\data.xml I even put it in quotes to make sure it is a string but I
      keep getting the same error.

      Any suggestions? It seems pretty straight forward.

      Thanks in advance,

      Andrew