You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by de...@areujoking.com on 2005/04/09 14:31:02 UTC

Loading Axis into a custom classloader

Hi,

I've been trying in vain for quite some time to isolate Axis Client
configurations from other Axis client configurations. The documentation
suggests that the way to do this is through classloaders. The idea being
that to isolate a configuration you create a new classloader and load your
isolated Axis in that classloader. It sounds plausible so I gave it a go.

The problem seems to be that Axis refuses to start when I load it into a
classloader that extends URLClassLoader. So what I do is get my client
"xxxxImpl" class which is generated by WSDL2Java and load it with the new
classloader. This caused Axis and its dependencies to be loaded by my new
Classloader (my classloader is child-first so that I can ensure that Axis
is loaded by my new classloader). But Axis refuses to load, it throws a
NPE and gives me this debug logging:

WARN - Factory
org.apache.axis.configuration.EngineConfigurationFactoryDefault Ignored:
missing required method: public static EngineConfigurationFactory
newFactory(Object).

DEBUG-
org.apache.axis.i18n.resource::handleGetObject(engineConfigFactoryMissing)

ERROR - Unable to locate a valid EngineConfigurationFactory

If you look through the code it shows you that a commons-discovery call is
made to ClassUtils.findPublicStaticMethod() and this is the one that seems
to be failing (causing Axis to fail loading in turn). All my classes are
loading into my classloader no problems - commons-dicovery included. Axis
just won't play.

Has anybody been successful in loading Axis under their own classloader?
Are there any special tricks to it? Is this a question better suited to
the axis-dev list?

Cheers,
Deakin.