axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <>
Subject Re: [axis2] Quick ClassLoader questions
Date Tue, 05 Jun 2007 00:43:45 GMT
Hi Deepal!

Deepal Jayasinghe wrote:
>> So deployment.util.Utils.getClassLoader() sets up a classloader with a
>> classpath consisting of:
>> - The passed root dir (i.e. modules/ or services/)
>> - The "lib" and "Lib" subdirs
>> - Any jar files found in "lib"/"Lib"
> Yes correct.
>> 1) Who uses "Lib/" with a capital L?  Do we need this?
> We just have added that to support both Lib and lib cases , but if you
> think no one is going to use Lib then let's remove that.

+1 to remove it, unless we have a use-case for it (anyone?)...

>> 2) Should the classpath actually include the "lib/" dir itself?  If we
>> want to support unjarred class access, that should be in a separate
>> "classes/" directory, IMHO (just like WEB-INF/lib and
>> WEB-INF/classes)....
> Well , all the jar files and resources in the lib (mar or aar) can be
> access via the corresponding class loader. Abt the classes we are too
> late to add that and the way we have right now is ok too. no need to
> have separate classes directory inside the aar or mar you can just put
> your .class file inside the archive file.

The lib/ directory should contain jars, not classes directly, right?  I 
agree that lib/*.jar should be added to the classpath, but I was asking 
about lib/ itself.  Right now if you had 
lib/org/apache/axis2/SomeClass.class, that class would be available, 
which I do not think is appropriate.  That's what a classes/ directory 
is for.

>> 3) Should the classpath actually include the root dir itself?  If so,
>> why?
> I think you mean root directory of the archive file , yes we need to do
> so . If someone put some resources under the archive file then he need
> to be able to load them.

No, I mean the actual modules/ or services/ directory!  Unless I'm 
reading things incorrectly, seems to add the base 
directory to the classpath.  This gets called 1) once for the repo base 
directory itself, 2) once each for services/ and modules/, and then 3) 
once for each service.  In cases 1 and 2, I believe this behavior is at 
least questionable if not incorrect.

For the service case, case 3 above, that's the same thing you're talking 
about as the root of the .aar file.  Is that really where we want 
classes loaded from?  We support "lib" directories in service archives, 
and the lib/ directories in there should contain (as mentioned above) 
jar files, NOT classes.  What if someone has a class called 
"lib.BookManager" in their service?  Wouldn't we then have to put that 
class file into the lib/ directory in the service deployment, mixing it 
in with the jar files?  This is why WAR/EAR files have separate lib/ and 
classes/ roots.

I'm a bit concerned that we load from a few too many places right now, 
which could lead to unintended confusion down the road.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message