[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [virgo-dev] Classloading & Inner frameworks supportability commands

Hi Hristo

Thanks for bringing forward this contribution! Diagnostics and debug aids are certainly an important area for Virgo.

A basic question first: why do you think this contribution is more applicable to Virgo than to base Equinox?

Next - please could you explain why it is necessary to use a javaagent as that could potentially cause performance issues and it seems to cut across the normal OSGi class loading style?

Are there any parts of the code which hold on to references to class loaders and which may prevent normal garbage collection from occurring?

I'll probably have more questions later, but I thought it would be worth trying the code out so I followed your instructions and, on a Mac, got the following:

>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)
> ls /Users/glynnormington/contrib/inner_frk/
FDAgent_1.1.jar FDLib.jar FrameworkInfoCommand_1.1.1.jar javassist.jar
> echo $JAVA_OPTS
-javaagent:/Users/glynnormington/contrib/inner_frk/FDAgent_1.1.jar
> bin/startup.sh
Exception in thread "main" java.lang.NoClassDefFoundError: javassist/NotFoundException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:294)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Caused by: java.lang.ClassNotFoundException: javassist.NotFoundException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed
/Users/glynnormington/virgo-web-server-2.1.0.M01/bin/dmk.sh: line 228:  5531 Abort trap              $JAVA_HOME/bin/java $JAVA_OPTS $DEBUG_OPTS $JMX_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$KERNEL_HOME/serviceability/error.log -XX:HeapDumpPath=$KERNEL_HOME/serviceability/heap_dump.hprof -Djava.security.auth.login.config=$CONFIG_DIR/org.eclipse.virgo.kernel.authentication.config -Dorg.eclipse.virgo.kernel.authentication.file=$CONFIG_DIR/org.eclipse.virgo.kernel.users.properties -Djava.io.tmpdir=$TMP_DIR -Dorg.eclipse.virgo.kernel.home=$KERNEL_HOME -classpath $CLASSPATH org.eclipse.virgo.osgi.launcher.Launcher -config $KERNEL_HOME/lib/org.eclipse.virgo.kernel.launch.properties -Forg.eclipse.virgo.kernel.home=$KERNEL_HOME -Forg.eclipse.virgo.kernel.config=$CONFIG_DIR -Fosgi.configuration.area=$KERNEL_HOME/work/osgi/configuration -Fosgi.java.profile="file:$KERNEL_HOME/lib/java6-server.profile" $LAUNCH_OPTS $ADDITIONAL_ARGS

Any ideas?

Thanks,
Glyn

On 5 Jul 2010, at 11:40, Iliev, Hristo wrote:

Hi,

We are currently working on some supportability features for OSGi and in particular Equinox. This includes:
*         Classloading - by a given class name list all bundles that:
o    contain it
o    export it
o    can load it
*         Inner frameworks
o    lists all inner frameworks in a tree view
o    lists details:
*  Start time
*  Origin bundle
*  System bundle's class
*  Startup call stack
o    executes certain commands in the inner framework (list, start/stop, install/uninstall/update)

The classloading commands (bundle) can be found here:
https://sapmats-de.sap-ag.de/download/download.cgi?id=CUWKAJZQLCZSTY7Z2185H84U6AAYD0DRXF4AYH91J8HGVL9SD7

The inner framework files can be found inside the zip located here:<https://wiki.wdf.sap.corp/wiki/download/attachments/759500197/inner_frk.zip>
https://sapmats-de.sap-ag.de/download/download.cgi?id=KK9O6JT63JK03W4QTOZMFW6SJGF77VIK9VKNUZMUWKJCBZX8F3

To install the inner framework bundles & agent:
1.  Place the three main components in one folder (Java agent(FDAgent), Collector library(FDLib), instrumentation library(javassist))
2.  Add the package of the framework collector library (com.sap.osgi.frameworkdetection.lib) to the bootdelegation property (org.osgi.framework.bootdelegation). Before starting the server add -javaagent:<path-to-the-agent>FDAgent_1.1.jar to the command line after the java keyword.
3.  Install the Framework Detection Command bundle in the Equinox environment you just launched, start that bundle and use the commands it provides.


We would like to contribute the code to Virgo since we think the commands will make the diagnostics of problems (often needed in server environment) much easier.

What do you about this idea?

Regards,
Hristo Iliev


<ATT00001..txt>