You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/07/02 00:05:18 UTC

DO NOT REPLY [Bug 21247] New: - ClassReader bypasses class loader set in ClassUtils

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21247>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21247

ClassReader bypasses class loader set in ClassUtils

           Summary: ClassReader bypasses class loader set in ClassUtils
           Product: Axis
           Version: 1.1
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: yakulis@avaya.com


org.apache.axis.utils.bytecode.ClassReader should use 
org.apache.axis.utils.ClassUtils to load classes and not 
Class.getResourceAsStream().  Using Class.c.getResourceAsStream() bypasses the 
class loader that you can set in ClassUtils.   A ClassLoader subclass however 
does not define a method that returns the class as bytes or a stream.  So, 
ClassUtils should also be modified to allow the "set" class loader to be a 
class that defines a method that can return the class as a stream or bytes.

  public static void setClassLoader(String className, AxisClassLoader loader);

  public abstract AxisClassLoader {
  ...
  ...
  public byte[] loadClassData(String name);
  ...
  ...
}

Assuming ClassUtils is also altered to have a loadClassData methos, this would 
allow ClassReader.getbytes() to use ClassUtils and not have a custom class 
loader bypassed.

I ran into this problem when trying to instantiate WSDL2Java class 
programatically in a eclipse plugin, I was creating, to generate the 
WSDL file for a Java class file.   However, I needes to have a custom 
class loader since the classpath for the plugin does not include the 
project the plugin is operating on.

Ross