JBoss 4.2..classloader...aaarrrgh !!

Help
Anonymous
2010-04-07
2013-04-17

  • Anonymous
    2010-04-07

    Hi All,

    I have tired all possible options in making JIP instrument my classes in the WAR on Jboss 4.2.x but it simply refuses to work :-(
    I used the default jboss.profile.properties. That didnt work

    I tried all of these combinations in various ways :
    #ClassLoaderFilter.1=net.sourceforge.jiprof.instrument.clfilter.Info
    #ClassLoaderFilter.2=com.mentorgen.tools.profile.instrument.clfilter.WebAppClassLoaderFilter
    #ClassLoaderFilter.3=net.sourceforge.jiprof.instrument.clfilter.JBossUniversalClassLoaderFilter
    ClassLoaderFilter.1=net.sourceforge.jiprof.instrument.clfilter.GenericClassLoaderFilter
    #ClassLoaderFilter.1=net.sourceforge.jiprof.instrument.clfilter.AllClassLoaders
    accept-class-loaders=org.jboss.web.tomcat.service.WebAppClassLoader

    ,but that didnt work. JIP is profiling all the Jboss classes that get started including the classes at the EAR level I think. But anything in my war it doesnt instrument.

    I tried finding out the classloader and parent heirarchy from one of my classes in the WAR that gets loaded and here is the output :
    com.xx.yy(a4ceeb).ClassLoader=WebappClassLoader
      delegate: false
      repositories:
        /WEB-INF/classes/
    -------> Parent Classloader:
    java.net.FactoryURLClassLoader@14e430c

    ..WebappClassLoader
      delegate: false
      repositories:
        /WEB-INF/classes/
    -------> Parent Classloader:
    java.net.FactoryURLClassLoader@14e430c

    ….file:/C:/server/default/deploy/myapp.war/WEB-INF/classes/
    ./.<more jars from the war>
    ….va.net.FactoryURLClassLoader@14e430c
    ..org.jboss.mx.loading.UnifiedClassLoader3@1200089{ url=file:xxx ,addedOrder=45}
    ..org.jboss.system.server.NoAnnotationURLClassLoader@cdb06e
    ..sun.misc.Launcher$AppClassLoader@14fe5c
    ….file:/C:/jdk1.6.0_14/lib/tools.jar
    ….file:/C:/jboss-4.2.3.GA/bin/run.jar
    ….file:/C:/jboss-4.2.3.GA/server/default/db/
    ….file:/C:/jip/profile/profile.jar
    ..sun.misc.Launcher$ExtClassLoader@47858e
    ….file:/C:/jdk1.6.0_14/jre/lib/ext/dnsns.jar
    ….file:/C:/jdk1.6.0_14/jre/lib/ext/localedata.jar
    ….file:/C:/jdk1.6.0_14/jre/lib/ext/sunjce_provider.jar
    ….file:/C:/jdk1.6.0_14/jre/lib/ext/sunmscapi.jar
    ….file:/C:/jdk1.6.0_14/jre/lib/ext/sunpkcs11.jar

    The code to print the above is from jboss.util.Debug class ( http://lists.jboss.org/pipermail/jboss-cvs-commits/2006-November/011490.html)

    Can anybody help me in setting the correct classloaderfilter so that I can instrument the classes in my war ??
    I dont even mind instrumenting all of them ( inlcuding jboss )  !

    Appreciate any pointers.
    thanks
    Pat

     

  • Anonymous
    2010-04-08

    I figured it out.
    I had to create another Filter which basically selects the "org.jboss.web.tomcat.service.WebAppClassLoader" Loader .
    Create a class which implements the com.mentorgen.tools.profile.instrument.clfilter.ClassLoaderFilter interface and accepts a classloader of name "org.jboss.web.tomcat.service.WebAppClassLoader".

    I was able to see my App output once I used the above filter.

    thanks
    Pat