Issue Details (XML | Word | Printable)

Key: AXIS2-1047
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Deepal Jayasinghe
Reporter: Raymond Feng
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Axis 2.0 (Axis2)

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

Created: 18/Aug/06 06:41 PM   Updated: 26/Aug/06 11:47 AM
Return to search
Component/s: deployment
Affects Version/s: 1.0
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 26/Aug/06 11:47 AM


 Description  « Hide
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



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Deepal Jayasinghe made changes - 22/Aug/06 08:02 AM
Field Original Value New Value
Assignee Deepal Jayasinghe [ deepal ]
Deepal Jayasinghe made changes - 26/Aug/06 11:47 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]