tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: About scanAllDirectories,JarScanner and expanded JAR
Date Thu, 18 Dec 2014 14:18:46 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mark,

On 12/18/14 3:44 AM, Mark Thomas wrote:
> On 18/12/2014 01:57, Nan Ge wrote:
>>> 
>>> 
>>> Which part of "WEB-INF/lib is only ever scanned for JARs.
>>> Everything else is ignored." did you not understand?
>> 
>> 
>> Yes, I see that only WEB-INF/lib/*.jar files are scanned.
>> 
>> 
>>>> And which directories/classpath  the document indicates when
>>>> it saying
>>> "If
>>>> true, any directories found on the classpath will be checked
>>>> to see if
>>> they
>>>> are expanded JAR files" , if it "won't work for either of
>>>> those directories"?
>>> 
>>> As per the docs, scanAllDirectories applies to directories
>>> found on the class path not to WEB-INF/lib since it is not on
>>> the class path. (WEB-INF/lib/*.jar is on the class path and
>>> that is not a directory).
>>> 
>> And for WEB-INF/classes, only unpacked classes and
>> resources(without any top-level non-package-name directories) are
>> accepted, an "expanded JAR file" is not accepted here.
> 
> Wrong. If WEB-INF/classes/META-INF exists and scanAllDirectories is
> set, the contents of WEB-INF/classes will be treated as an expanded
> JAR.

This sounds odd to me; isn't WEB-INF/classes *always* treated as if it
were an "expanded JAR file"? That is, WEB-INF/classes is directly in
the webapp's classpath and resources in there can be loaded by the
classloader. If foo.jar (regardless of its location) were on the
classpath, anything inside of it can be loaded by the classloader.

It doesn't make any sense to me to differentiate between
WEB-INF/classes as ... whatever it is usually considered, and using
scanAllDirectories="true" to treat is as an "expanded JAR file"
because the behavior -- as best as I can tell -- is entirely identical.

I've read the documentation for <JarScanner> several times now because
of this thread, and it's entirely unclear to me what e=the difference
in behavior will be given that documentation plus your comments here.

Mark, can you clarify what behavior will actually change when
scanAllDirectories="true" is set?

>> Then where else should I put an "expanded JAR file", except 
>> WEB-INF/lib and WEB-INF/classes?
> 
> "should" depends on what you are trying to achieve - something you 
> haven't yet explained.

I get what you're trying to do, here, and its not entirely clear to me
under what circumstances an "expanded JAR file" would be useful. It
would be nice to understand a proper use-case for this feature,
because one presumably exists or the feature would not.

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUkuJGAAoJEBzwKT+lPKRY62kQAIb5pFsSeGVvRZDt9bDcyMm8
bHhYAY+e/vp97BWms7McBy9XZlYC5sH5UrSvGNBi1YrxNxVoQwQ4CqDEdXKpiQW1
PuxBQYJ5Bz3xaWzxQF9EEPIuFgspVnOu6bEHUGvP07LocFFWjXHCV+JN/onCERPI
G0T3Q1R2d/7fYsv3G4YM4+ofxqmaX0awDH6bmjznuTv68t/oY5JyR49Zev1r39jo
R/8kYjlNj8hoSbP/E9G7nqVwz4xdaL+yXsw/ATEr2tDC/7Q55ouXCbsX67H4wggt
Mb748b+gYxfaDrL3BCa2F7WGuold3APmOeT1jpWaumZEhCcogjSj5p/t8s+KaXID
rz6QDoj3ofF4cCiHLKTgA6KIE/HHYOsq31Kk0Q6rnuqmEvTKkOAOjpVU50Uz/tqo
FAJLuGnPfz/nZlH6K2Cg/qiftBXGSjiZtLR46w+I/nuishk3Lo0EtBMmnNJ6ErzQ
tmIXSAZxqAFMjVyLrbt/7XtpG+ZMtQeGP+NT3XllchX78f2PU9xe9svL1Acxaoiu
96BIFS0CpTPZ1tq86L2qvPUyOGVwf6LnNCjbXOg8fJDT38KOaa/pSXRF1UFteV5K
CX9xUgD08hHvTuXy4kQyWAwjnqIZHgWYPx1bk4fTxHqShLPwU5rsEjsQkg+sUGfN
rCDxyDa0UTvJVa8/XBrD
=wXLV
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message