4 Replies Latest reply on Apr 15, 2003 2:27 PM by Juha Lindfors

    Why am I given this exception by MLET?

    Alexander Rabinowitz Newbie

      I have the following code for MLET:

      String pulsarName = "com.peerdirect.rmapplications.master.jmx.PulsarModel" ;
      MLet mlet = new MLet();
      //Object pulsar = Class.forName (pulsarName).newInstance();
      String name = myMBeanServer.getDefaultDomain() + ":type=" + pulsarName;
      name = "type:name=mlet";
      System.out.println ("MLET: " + name);
      ObjectName objName = new ObjectName(name);
      myMBeanServer.registerMBean (mlet, objName);
      //final String MLET_URL = "file:./output/etc/test/compliance/loading/BasicConfig.mlet";
      //final String MLET_URL = "C:\\aa\\BasicConfig.mlet";
      final String MLET_URL = "file:///C:/aa/BasicConfig.mlet";
      try
      {
      DefaultLoaderRepository.loadClass (pulsarName);
      System.out.println("Too bad");
      }
      catch (Exception ignored)
      {}
      myMBeanServer.invoke (objName, "getMBeansFromURL",
      new Object[] { MLET_URL },
      new String[] { String.class.getName() }
      );

      Also, I have the following MLET tag in my BasicConfig.mlet file:
      <MLET CODE=com.peerdirect.rmapplications.master.jmx.PulsarModel
      NAME="DefaultDomain:type=com.peerdirect.rmapplications.master.jmx.PulsarModel"
      CODEBASE="file:///C:/build/GUI2/ram/run_agent"
      ARCHIVE="PeerdirectMasterServerFull.jar"
      >


      I have the following exception:
      Creating an instance of MasterAgent...
      MLET: type:name=mlet
      RuntimeMBeanException: RuntimeException in MBean operation 'getMBeansFromURL(,java.lang.String)'
      Cause: java.lang.ClassCastException: org.jboss.mx.loading.UnifiedClassLoader
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:299)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at com.peerdirect.rmapplications.agent.BaseAgent.(BaseAgent.java:93)
      at com.peerdirect.rmapplications.agent.MasterAgent.(MasterAgent.java:5)
      at com.peerdirect.rmapplications.agent.MasterAgent.main(MasterAgent.java:15)

      At the same time my file C:/build/GUI2/ram/run_agent/PeerdirectMasterServerFull.jar contains file com\peerdirect\rmapplications\master\jmx\PilsarModel.class

      What is wrong? Why am I getting the exception?

      My http adapter shows on my mlet mbean:

      LibraryDirectory java.lang.String RW UNAVAILABLE: [RuntimeErrorException: Error in MBean when getting attribute 'LibraryDirectory' Cause: java.lang.Error: NYI]
      URLs java.net.URL[] RO view the values of URLs