Friday, December 18, 2009

The inner ugliness of beehive

when using WLI, lots of threads are in wait on a classloading:


[ACTIVE] ExecuteThread: '186' for queue: 'weblogic.kernel.Default (self-tuning)'
   weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(String)
   org.apache.beehive.netui.pageflow.internal.DefaultReloadableClassHandler.loadClass(String)
   org.apache.beehive.netui.pageflow.FlowControllerFactory.getFlowControllerClass(String)
   org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.getFlowController(RequestContext, String)
   org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(HttpServletRequest, HttpServletResponse)
   org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(HttpServletRequest, HttpServletResponse)
   org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(HttpServletRequest, HttpServletResponse)
   org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(HttpServletRequest, HttpServletResponse)
   org.apache.struts.action.ActionServlet.doPost(HttpServletRequest, HttpServletResponse)
   javax.servlet.http.HttpServlet.service(HttpServletRequest, HttpServletResponse)

this is the source:

http://svn.apache.org/repos/asf/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
 
private transient ReloadableClassHandler _rch;
/**
     * Get a FlowController class.  By default, this loads the class using the thread context class loader.
     * 
     * @param className the name of the {@link FlowController} class to load.
     * @return the loaded {@link FlowController} class.
     * @throws ClassNotFoundException if the requested class could not be found.
     */
    public Class getFlowControllerClass( String className )
        throws ClassNotFoundException
    {
        return _rch.loadClass( className );
    }

ReloadableClassHandler :
 
http://svn.apache.org/repos/asf/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultReloadableClassHandler.java
public Class loadClass( String className )
        throws ClassNotFoundException
    {
        if ( _pageFlowClassLoader != null )
        {
            synchronized ( this )
            {
                return Class.forName(className, false, _pageFlowClassLoader);
            }
        }
        
        return Class.forName(className, false, DiscoveryUtils.getClassLoader());
}
ReloadableClassHandler has also a 
public Class loadCachedClass( String className )
which would save us from Class.forName (highly deprecated for performance reasons....)
 
I think a patch is needed, or some sort of hack...
Beehive is a loser, it has not been touched since 2006....
 



No comments: