axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jung , Dr. Christoph" <christoph.j...@infor.de>
Subject Proposed Extension to org.apache.axis.Handler: get/setClassLoader
Date Tue, 02 Oct 2001 16:57:36 GMT
Hi there,

while integrating Axis as a hot-deploying service into JBoss 

(BTW: what do you think about Web Service aRchives, *.wsr´s quite similar
and maybe connected to *.ear´s, *.war´s and *.jar´s, containing both java
code - service logic, serializers, special handlers, etc - and an axis
deployment descriptor under META-INF/web-service.xml?) 

I came across an interesting classloading issue, that is: the context
classloader of a deployment thread that is invoked by, e.g., a management
console or a file watchdog, will be most likely a different one to the
context classloader of the  web-server´s http worker invoking the
AxisServlet.

Currently, most of the Java classnames in deploy.xml are resolved at
deployment time (thx to Admin.processEngine()). Hence the generic Axis
invocation layer will decently interoperate with the specific
representations hot-plugged into it.

Some of the referred classes however are hidden in generic handler options,
like <service> <option name="classname" value="bla"/> </server> needed by
org.apache.axis.providers.java.JavaProvider, and are only resolved at
servlet-invocation time ... with the result of ClassNotFoundExceptions in
the hot-deploy case.

A workaround that I have found was to store for each service also the
associated deployment classLoader in AxisServer. When
MessageContext.setTargetService() is called, it will invoke
setContextClassLoader() to the right deployment classloader as a by-product.
Since JavaProvider uses the MessageContext.getClassLoader() for resolution,
this will work.

I think that maybe it would be an even better design to have each handler
and maybe typemapping instance being associated with its deployment
classloader such that there is a definite way of resolving associated
resources, classnames etc. at each point in time. 

Please let me know what you think of this deployment scenario and the
possible ways of realizing it. I would be glad to contribute some patches
and code (I have a provider for JMX-MBeans ready, interested?).

Dr. Christoph G. Jung

Software Engineer
infor: business solutions AG
http://www.infor.de/
mailto:Christoph.Jung@infor.de


Mime
View raw message