1 Reply Latest reply on Apr 7, 2005 10:09 AM by Daniel Fröding

    MLet StackOverflowError

    Daniel Fröding Newbie

      I try to load two MBeans via the javax.management.loading.MLet class and the getMBeansFromURL method.

      I keep getting an StackOverflowError, I guess caused by some class loading problem.

      This works on Sun AS 8.1 and on WebLogic 9.0...

      Here is the mlet tags:

      <MLET
      CODE=com.j2ee.jmx.J2ee.class
      ARCHIVE=j2ee-jmx.jar
      CODEBASE=/
      NAME=MLetTest:name=J2ee
      >

      <MLET
      CODE=com.j2ee.jmx.J2eeJmxNotificationListener.class
      ARCHIVE=j2ee-jmx.jar
      CODEBASE=/
      NAME=MLetTest:name=J2eeJmxNotificationListener
      >



      Some code:
      String domain = mBeanServer.getDefaultDomain();

      String mletClass = "javax.management.loading.MLet";
      ObjectName mletName = new ObjectName(domain + ":name=" + mletClass);
      if(!mBeanServer.isRegistered(mletName))
      {
      mBeanServer.createMBean(mletClass, mletName);
      }

      Object mletParams[] = {"http://localhost:8088/mlets.html"};
      String mletSignature[] = {"java.lang.String"};
      Set mbeanSet = (Set) mBeanServer.invoke(mletName, "getMBeansFromURL", mletParams, mletSignature);

      I get the following error:
      Caused by: java.lang.StackOverflowError
      at org.jboss.mx.loading.RepositoryClassLoader.hashCode(RepositoryClassLoader.java:718)
      at java.util.HashMap.hash(HashMap.java:257)
      at java.util.HashMap.containsKey(HashMap.java:335)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromCache(UnifiedLoaderRepository3.java:361)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:284)
      at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:518)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:200)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromRepository(UnifiedLoaderRepository3.java:427)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:305)
      at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:518)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:200)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromRepository(UnifiedLoaderRepository3.java:427)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:305)
      at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:518)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:200)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromRepository(UnifiedLoaderRepository3.java:427)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResource(UnifiedLoaderRepository3.java:305)
      at org.jboss.mx.loading.RepositoryClassLoader.getResource(RepositoryClassLoader.java:518)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at java.lang.ClassLoader.getResource(ClassLoader.java:775)
      at org.jboss.mx.loading.RepositoryClassLoader.getResourceLocally(RepositoryClassLoader.java:200)
      at org.jboss.mx.loading.UnifiedLoaderRepository3.getResourceFromRepository(UnifiedLoaderRepository3.java:427)
      .... This loops until the stack is overflowed.

      Any ideas??