axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "João Luís Pinto" <joaoluispi...@gmail.com>
Subject Re: Possible classloader issue - help needed
Date Fri, 26 Oct 2007 13:17:14 GMT
Hi,

<code>
log1.debug("Loading " + url); //$NON-NLS-1$

ClassLoader loader =
AgentPlatformServiceMessageReceiverInOut.class.getClassLoader();
if (loader != null)
{
    log1.debug("AgentPlatformServiceMessageReceiverInOut: " //$NON-NLS-1$
        + loader.getClass().getName());
    getParents("AgentPlatformServiceMessageReceiverInOut", loader);
//$NON-NLS-1$
}

loader = Digester.class.getClassLoader();
if (loader != null)
{
    log1.debug("Digester: " //$NON-NLS-1$
        + loader.getClass().getName());
    getParents("Digester", loader); //$NON-NLS-1$
}

loader = CatalogBase.class.getClassLoader();
if (loader != null)
{
    log1.debug("CatalogBase: " //$NON-NLS-1$
        + loader.getClass().getName());
    getParents("CatalogBase", loader); //$NON-NLS-1$
}

configParser.parse(url);
</code>

<code>
private void getParents(String string, ClassLoader loader)
{
    ClassLoader classLoader = loader;
    while ((classLoader = classLoader.getParent()) != null)
    {
        log1.debug("Parent(" + string + "): " +
loader.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
    }
}
</code>

On 10/26/07, Brennan Spies <brennanspies@sbcglobal.net> wrote:
 > 1) Create a simple utility method that recurses up the classloading tree
> using ClassLoader.getParent()--stop when you get a null from this method.
> Print out the class name of each ClassLoader.
> 2) Also print out the class name of each ClassLoader for the classes of
> interest: Digester, CatalogBase (the impl version), ConfigCatalogRule,
> AgentPlatformServiceMessageReceiverInOut. Don't create a new instance; use a
> static reference to the class like
> 'ConfigCatalogRule.class.getClassLoader()'. To be thorough, you should check
> to see if this is null before doing getClass().getName().

I get:

[DEBUG] Loading
file:/Users/jpinto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Axis2/WEB-INF/services/AgentPlatformService/chain-config.xml
[DEBUG] AgentPlatformServiceMessageReceiverInOut: java.net.URLClassLoader
[DEBUG] Parent(AgentPlatformServiceMessageReceiverInOut):
java.net.URLClassLoader
[DEBUG] Parent(AgentPlatformServiceMessageReceiverInOut):
java.net.URLClassLoader
[DEBUG] Parent(AgentPlatformServiceMessageReceiverInOut):
java.net.URLClassLoader
[DEBUG] Parent(AgentPlatformServiceMessageReceiverInOut):
java.net.URLClassLoader
[DEBUG] Parent(AgentPlatformServiceMessageReceiverInOut):
java.net.URLClassLoader
[DEBUG] Parent(AgentPlatformServiceMessageReceiverInOut):
java.net.URLClassLoader
[DEBUG] Digester: java.net.URLClassLoader
[DEBUG] Parent(Digester): java.net.URLClassLoader
[DEBUG] Parent(Digester): java.net.URLClassLoader
[DEBUG] Parent(Digester): java.net.URLClassLoader
[DEBUG] Parent(Digester): java.net.URLClassLoader
[DEBUG] Parent(Digester): java.net.URLClassLoader
[DEBUG] Parent(Digester): java.net.URLClassLoader
[DEBUG] CatalogBase: java.net.URLClassLoader
[DEBUG] Parent(CatalogBase): java.net.URLClassLoader
[DEBUG] Parent(CatalogBase): java.net.URLClassLoader
[DEBUG] Parent(CatalogBase): java.net.URLClassLoader
[DEBUG] Parent(CatalogBase): java.net.URLClassLoader
[DEBUG] Parent(CatalogBase): java.net.URLClassLoader
[DEBUG] Parent(CatalogBase): java.net.URLClassLoader
[ERROR] Begin event threw exception
java.lang.ClassNotFoundException: org.apache.commons.chain.impl.CatalogBase
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
(...)

I cannot do it for ConfigCatalogRule, because it has default (not
public) visibility [1].

[1] http://commons.apache.org/chain/xref/org/apache/commons/chain/config/ConfigCatalogRule.html

Thanks,

João

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message