0 Replies Latest reply on Oct 13, 2010 12:11 AM by malcolm.lett

    Tool to parse/reformat JBoss Classloader printout

    malcolm.lett

      Sometimes classloading errors are presented in the jboss 5 server logs along with a printout of the class loader being used, such as in the following excerpt (the full raw version is attached):

       

      java.lang.ClassNotFoundException: org.apache.http.HttpEntity from BaseClassLoader@3ea1e9b0{VFSClassLoaderPolicy@77f541ef{.....(substantially truncated)....}
      

       

      The printout in full contains very detailed information about what jars and packages the classloader is aware of and would be very useful in debugging, if it weren't for the fact that there's so much in there it's impossible to read.

       

      Does anyone know of a tool that would parse it and reformat so that it's human readable.

       

      Here's an example of what I'd like - I did this manually and it takes a while (note: I've truncated this substantially in the interests of readability):

       

      BaseClassLoader@3ea1e9b0{ VFSClassLoaderPolicy@77f541ef{
          name=vfsfile:/C:/java/jboss-5.1.0.GA/server/default/conf/jboss-service.xml
          domain=ClassLoaderDomain@77bdbf9d{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@50d17ec3}
          roots=[
              MemoryContextHandler@112979824[path= context=vfsmemory://4sg15c-coglku-gf7k70t7-1-gf7k78ge-7 real=vfsmemory://4sg15c-coglku-gf7k70t7-1-gf7k78ge-7],
              DelegateHandler instances [
                   path:                                               context:                                              real:
                   cdzlet.jar                                          file:/C:/java/jboss-5.1.0.GA/server/default/lib/      file:/C:/java/jboss-5.1.0.GA/server/default/lib/cdzlet.jar
                   cecore.jar                                          file:/C:/java/jboss-5.1.0.GA/server/default/lib/      file:/C:/java/jboss-5.1.0.GA/server/default/lib/cecore.jar
                   celib.jar                                           file:/C:/java/jboss-5.1.0.GA/server/default/lib/      file:/C:/java/jboss-5.1.0.GA/server/default/lib/celib.jar
                   ceplugins.jar                                       file:/C:/java/jboss-5.1.0.GA/server/default/lib/      file:/C:/java/jboss-5.1.0.GA/server/default/lib/ceplugins.jar
                   bsf.jar                                             file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/bsf.jar
                   commons-logging.jar                                 file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/commons-logging.jar 
                   hibernate-annotations.jar                           file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/hibernate-annotations.jar
                   hibernate-jmx.jar                                   file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/hibernate-jmx.jar
                   jboss-security-spi.jar                              file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/jboss-security-spi.jar
                   jbossts-common.jar                                  file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/jbossts-common.jar
                   joesnmp.jar                                         file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/joesnmp.jar
                   log4j.jar                                           file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/log4j.jar
                   properties-plugin.jar                               file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/properties-plugin.jar
                   scheduler-plugin-example.jar                        file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/scheduler-plugin-example.jar
                   servlet-api.jar                                     file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/servlet-api.jar
                   slf4j-jboss-logging.jar                             file:/C:/java/jboss-5.1.0.GA/common/lib/              file:/C:/java/jboss-5.1.0.GA/common/lib/slf4j-jboss-logging.jar
              ]
          ]
          delegates=null
          exported=[
              antlr.actions.cpp,
              bsh.classpath,
              com.arjuna.ArjunaOTS,
              com.businessobjects.cdzlet,
              com.crystaldecisions.celib.a,
              com.ibatis.common.beans,
              com.sun.mail.handlers,
              com.sybase.jdbc3.a,
              javax.annotation,
              javax.ejb,
              org.apache.bcel.verifier,
              org.hibernate.dialect,
              org.hibernate.sql,
              org.jboss.cache.invalidation,
              org.jboss.ejb3.common.metadata,
              org.jboss.metadata.common.spi,
              org.jboss.varia.scheduler,
              org.jboss.xnio.log,
              org.springframework.core.convert.converter,
              org.springframework.util.xml,
              org.w3c.dom,
              schema,
              security,
              stylesheets,
              xmdesc,
          ]
          <IMPORT-ALL>NON_EMPTY
      }}
      
      

       

       

      In fact, something that just has the generic ability to match up brackets and format based on them would get a big start towards this.