{
if (server == null)
throw new ServiceNotFoundException("Loader must be registered to the server before loading the MBeans.");
HashSet mbeans = new HashSet();
MBeanElement element = null;
try
{
MBeanFileParser parser = new MLetParser();
Set mlets = parser.parseMBeanFile(url);
if (mlets.size() == 0)
throw new ServiceNotFoundException("The specified URL '" + url + "' does not contain MLET tags.");
Iterator it = mlets.iterator();
while (it.hasNext())
{
element = (MBeanElement)it.next();
String codebase = element.getCodebase();
// if no codebase is specified then the url of the mlet text file is used
if (codebase == null)
codebase = url.toString().substring(0, url.toString().lastIndexOf('/'));
Iterator archives = element.getArchives().iterator();
String codebaseURL = null;
while (archives.hasNext())
{
try