Context Class Loader  Locate

If SSJ runs in a server mode, it loads packages found in its application directory. Depending on a deployment descriptor (refer to the Deployment Descriptors section), the hierarchy of classloaders is created to load the classes. SSJ enables the Java class loader tree structure to be an acyclic oriented graph, i.e. the class loader can have more than one parents.

When a request is processed, the context classloader Thread.currentThread().getContextClassLoader() is set to the classloader that has loaded the service being used. This applies for interceptors, handlers, header processors and serializers/deserializers ( the custom deserializer should preferably use org.idoox.wasp.serialization.DeserializationContext.getClassLoader() ).

[Note]Note

However, the service's classloader can only load classes from parent packages if these packages are libraries ("library='true'" in package.xml).

Morover, the context class loader is set with a classloader that is able to load classes from the interceptor/handler/serializer/deserializer/service package for methods org.idoox.wasp.interceptor.Interceptor.load(Configurable config) and destroy() , javax.xml.rpc.handler.Handler.init(HandlerInfo config) and destroy() , init(Configurable configurable) on classes Serializer, Deserializer, XMLSerializer and XMLDeserializer from the org.idoox.wasp.serialization package and constructor of the service classes and methods implementing org.systinet.wasp.webservice.Initializable .