[jboss-cvs] JBossAS SVN: r63210 - trunk/jmx/src/main/org/jboss/mx/loading.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 25 11:40:12 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-05-25 11:40:11 -0400 (Fri, 25 May 2007)
New Revision: 63210

Modified:
   trunk/jmx/src/main/org/jboss/mx/loading/ClassLoadingTask.java
   trunk/jmx/src/main/org/jboss/mx/loading/LoadMgr3.java
Log:
JBAS-4441, enforce a maximum bound on LinkageError/ClassCircularity errors

Modified: trunk/jmx/src/main/org/jboss/mx/loading/ClassLoadingTask.java
===================================================================
--- trunk/jmx/src/main/org/jboss/mx/loading/ClassLoadingTask.java	2007-05-25 15:02:45 UTC (rev 63209)
+++ trunk/jmx/src/main/org/jboss/mx/loading/ClassLoadingTask.java	2007-05-25 15:40:11 UTC (rev 63210)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.mx.loading;
 
 import java.security.CodeSource;
@@ -159,6 +159,12 @@
       this.trace = log.isTraceEnabled();
    }
 
+   synchronized int incNumCCE()
+   {
+      int cce = numCCE ++;
+      return cce;
+   }
+
    public String toString()
    {
       StringBuffer buffer = new StringBuffer(super.toString());

Modified: trunk/jmx/src/main/org/jboss/mx/loading/LoadMgr3.java
===================================================================
--- trunk/jmx/src/main/org/jboss/mx/loading/LoadMgr3.java	2007-05-25 15:02:45 UTC (rev 63209)
+++ trunk/jmx/src/main/org/jboss/mx/loading/LoadMgr3.java	2007-05-25 15:40:11 UTC (rev 63210)
@@ -1,24 +1,24 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.mx.loading;
 
 import java.net.URL;
@@ -174,8 +174,6 @@
          return true;
       }
 
-      if( task.classname.equals("com.sun.ts.tests.webservices.deploy.warDeploy.HelloJavaBean") )
-         log.info("Saw "+task.classname);
       // Next get the set of class loaders from the packages map
       Set pkgSet = repository.getPackageClassLoaders(task.classname);
       if( pkgSet == null || pkgSet.size() == 0 )
@@ -305,8 +303,6 @@
          if( trace )
             log.trace("End beginLoadTask, ClassNotFoundException");
          String msg = "No ClassLoaders found for: "+task.classname;
-         if( task.classname.equals("com.sun.ts.tests.webservices.deploy.warDeploy.HelloJavaBean") )
-            log.info("Saw "+task.classname);
          throw new ClassNotFoundException(msg);
       }
 
@@ -407,7 +403,8 @@
       {
          boolean retry = e instanceof ClassCircularityError
             || e.getClass().equals(LinkageError.class);
-         if( retry )
+         int numCCE = loadTask.incNumCCE();
+         if( retry && numCCE >= 10 )
          {
             /* Reschedule this task after all existing tasks to allow the
             current load tasks which are conflicting to complete.
@@ -422,10 +419,10 @@
             catch(Throwable ex)
             {
                loadTask.setLoadError(ex);
-               log.warn("Failed to reschedule task after CCE", ex);
+               log.warn("Failed to reschedule task after LinkageError", ex);               
             }
             if( trace )
-               log.trace("Post CCE state, loadTask="+loadTask);
+               log.trace("Post LinkageError state, loadTask="+loadTask);
          }
          else
          {
@@ -622,7 +619,7 @@
          {
             taskList.add(subtask);
             // Order the tasks by either the heirarchial order, or the repository order
-            Collections.sort(taskList, task.taskComparator);
+            Collections.sort(taskList, ClassLoadingTask.taskComparator);
             taskList.notify();
          }
       }




More information about the jboss-cvs-commits mailing list