tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <cmanola...@yahoo.com>
Subject RE: Bug in TC 3.3 DependClassLoader
Date Wed, 12 Sep 2001 22:02:10 GMT
Sorry, I had a lot on my had in the last days.

Bojan - if you want to send a patch, it would be great. If not - I can fix
the bug ( but I would prefer you to send a patch - who knows, maybe later
you'll send another one, the first is allways harder :-)


Costin

On Wed, 12 Sep 2001, Larry Isaacs wrote:

> Hi Bojan,
>
> Costin is the expert on this section of code.  I need to become
> more familiar with it, so I'm willing to take a look.  If you can
> submit a patch, that would be helpful.  If you need to wait for
> Costin's advice, I understand.  On occasion, I have had to do
> the same.
>
> Cheers,
> Larry
>
> > -----Original Message-----
> > From: Bojan Smojver [mailto:bojan@binarix.com]
> > Sent: Wednesday, September 12, 2001 8:10 AM
> > To: Tomcat Dev List
> > Subject: Bug in TC 3.3 DependClassLoader
> >
> >
> > Since I was playing with distributing all my apps in jars...
> >
> > In method dependency() of that class, there is a section for jars. It
> > goes something like this:
> >
> > ----------------------------
> >         if( "jar".equals( res.getProtocol() )) {
> >             String fileN=res.getFile();
> >             int idx=fileN.indexOf( "!" );
> >             if( idx>=0 )
> >                 fileN=fileN.substring( 0, idx) ;
> >             f=new File( fileN );
> >             if( debug > 0 ) log( "Jar dep "  +f );
> >             if( ! f.exists()) f=null;
> >         }
> >
> >         if( f==null ) return;
> >         Dependency dep=new Dependency();
> >         dep.setLastModified( f.lastModified() );
> >         dep.setTarget( c );
> >         dep.setOrigin( f );
> >
> >         dependM.addDependency( dep );
> > ----------------------------
> >
> > So if the res is:
> >
> > ----------------------------
> > jar:file:/home/httpd/html/binarix.dev/WEB-INF/lib/app.jar!/com
> > /binarix/wpm/ParseXML.class
> > ----------------------------
> >
> > then fileN after res.getFile() is:
> >
> > ----------------------------
> > file:/home/httpd/html/binarix.dev/WEB-INF/lib/app.jar!/com/bin
> arix/wpm/ParseXML.class
> ----------------------------
>
> and after tossing everything after the bang, it becomes:
>
> ----------------------------
> file:/home/httpd/html/binarix.dev/WEB-INF/lib/app.jar
> ----------------------------
>
> which is NOT a file (a URL maybe?), so f.exists() returns false and f
> becomes null. The method dependency() returns without adding the jar in
> question to the list of dependencies. Aieeeee!
>
> Maybe there should be another 'file' section inside the 'jar' section to
> resolve that URL?
>
> If you guys think that'd work OK, I can write a little patch...
>
> Bojan
>


Mime
View raw message