Axis2 deployment cannot support isolated classloading of the axis2 runtime 
against application code
---------------------------------------------------------------------------------------------------

                 Key: AXIS2-1047
                 URL: http://issues.apache.org/jira/browse/AXIS2-1047
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: deployment
    Affects Versions: 1.0
            Reporter: Raymond Feng


In most of the Axis2 code, thread context classloader (TCCL) is used to resolve 
class by name as follows.

        Class.forName(clasName, true, 
Thread.currentThread().getContextClassLoader());

For example, AxisConfigBuilder uses it to resolve TransportReceiver and 
TransportSender. Please note the class can be suppiled by the application or by 
Axis2 (default).

This approach works well in the following two cases:
1) The class is provided by the application and it's visible to the TCCL.
2) The class is provided by Axis2 and the axis2 is loaded by either the 
application classloader or any ancestor of the application classloader.

We have a different use case. (similar as tomcat)
1) We load axis2 together with our library from an isolated classloader (CL1)
2) The application is running with its own classloader (TCCL=CL2)
3) CL2 cannot see classes in CL1

As a result, we got a ClassCastException for the Transport receiver and sender 
even they are from the Axis2. Would it make sense to support this case using 
the following:
Class cls = null;
try{
      cls = Class.forName(clasName, true, 
Thread.currentThread().getContextClassLoader()); // Try the application class 
loader
} catch (ClassNotFoundException e) {
      cls = Class.forName(className); // Try the axis2 classloader
}

Thanks,
Raymond



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to