public abstract class DebugUtils extends Object
debugClassLoadingThrowable(Throwable, Bundle, Class[])
which will
try to determine the cause by trying to load the given interfaces using the
given bundle.
The debugging process can be potentially expensive.Constructor and Description |
---|
DebugUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
debugClassLoading(org.osgi.framework.Bundle bundle,
String className,
String rootClassName)
Tries (through a best-guess attempt) to figure out why a given class
could not be found.
|
static void |
debugClassLoadingThrowable(Throwable loadingThrowable,
org.osgi.framework.Bundle bundle,
Class<?>[] classes)
Tries to debug the cause of the
Throwable s that can appear when
loading classes in OSGi environments (for example when creating proxies). |
public static void debugClassLoadingThrowable(Throwable loadingThrowable, org.osgi.framework.Bundle bundle, Class<?>[] classes)
Throwable
s that can appear when
loading classes in OSGi environments (for example when creating proxies).
This method will try to determine the class that caused the problem
and to search for it in the given bundle or through the classloaders of
the given classes.
It will look at the classes are visible by the given bundle on debug
level and do a bundle discovery process on trace level.
The method accepts also an array of classes which will be used for
loading the 'problematic' class that caused the exception on debug level.loadingThrowable
- class loading Throwable
(such as
NoClassDefFoundError
or ClassNotFoundException
)bundle
- bundle used for loading the classesclasses
- (optional) array of classes that will be used for loading
the problematic classpublic static void debugClassLoading(org.osgi.framework.Bundle bundle, String className, String rootClassName)
NoClassDefFoundError
caused by failure of loading transitive
classes (such as getting a NCDFE when loading foo.A
because bar.B
cannot be found).bundle
- the bundle to search for (and which should do the loading)className
- the name of the class that failed to be loaded in dot
format (i.e. java.lang.Thread)rootClassName
- the name of the class that triggered the loading
(i.e. java.lang.Runnable)Copyright © 2006–2019. All rights reserved.