Hello Chris,

Yes, I do agree that <JarScanner>/<JarScanFilter> docs do not look very
clear. We after different test ended up with configurations like this one
(${CATALINA_BASE}/conf/context.xml)

<JarScanner scanClassPath="false">
  <JarScanFilter tldSkip="*.*"/>
</JarScanner>

or this other one (${CATALINA_BASE}/conf/catalina.properties)

tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.*

for disabling completely the jar scanning.

Cheers,

Luis

ps: finally we decided to disable the jar scanning just for the jars that
we were adding ourselves in our custom tomcat image (keycloak for SSO,
jolokia for monitoring and some utilities). Our colleague Thomas added
below shell kung-fu to our Dockerfile

RUN jars_to_skip_in_tld_search=$(find ${CATALINA_BASE}/lib/* -printf "%f,")
\
 && line_number_of_beginning_of_skip_list=$(sed -n
'/tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\\/='
${CATALINA_BASE}/conf/catalina.properties) \
 && comment_to_insert="# Note: The first line of the list (and this
comment) was inserted while\n# building the image to skip TLD scanning of
our own jars." \
 && sed -i
"${line_number_of_beginning_of_skip_list}a\\${jars_to_skip_in_tld_search}\\\\"
${CATALINA_BASE}/conf/catalina.properties \
 && sed -i
"${line_number_of_beginning_of_skip_list}i\\${comment_to_insert}"
${CATALINA_BASE}/conf/catalina.properties \
 && echo "Will skip jars: ${jars_to_skip_in_tld_search}"

pps: BTW: thanks Thomas, it works!











El mié., 15 jul. 2020 a las 18:51, Christopher Schultz (<
ch...@christopherschultz.net>) escribió:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> All,
>
> On 7/15/20 10:14, Christopher Schultz wrote:
> > Reading the documentation for <JarScanner>/<JarScanFilter> it
> > looks like maybe this would work:
> >
> > <JarScanner> <JarScanFilter pluggabilityScan="" tldScan="" />
> > </JarScanner>
>
> With the above configuration, I still see this INFO log in my log file:
>
> INFO: At least one JAR was scanned for TLDs yet contained no TLDs.
> Enable debug logging for this logger for a complete list of JARs that
> were scanned but no TLDs were found in them. Skipping unneeded JARs
> during scanning can improve startup time and JSP compilation time.
>
> > Or maybe:
> >
> > <JarScanner> <JarScanFilter pluggabilitySkip="*" tldSkip="*" />
> > </JarScanner>
>
> Looks like this gets the job done.
>
> I'm curious: why does tldScan="" not work?
>
> > If I specify one of the above, will the JAR scan still occur
> > (meaning, enumerate the list of JAR files and run through them) but
> > no JAR files will actually be opened? Or will the scanning process
> > be skipped entirely if the JarScanner sees that its configuration
> > implies it will never do any work?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8PNBAACgkQHPApP6U8
> pFhkkBAAl1MLW79GuyPRC8QP/ZeWwFJcpDL52JgS7NR/xulENkybpFtqCjzfXdzv
> w8jMKDN6AkcFzVo6oNnGkuMn4hUKSVHE8y44kMNW49YNGn7xSnqXt8iXDOUVkrqv
> kP1S82Yjc3UZxfQ8CZrGU/VV8qCwGgbRwbNLJp6VdS0tedJCku9MI1KpVu1tKCi0
> uSV+39j6DRAnWgdnaCaxRPBROm0R7d5TB2fR+C/uzfxXnxaL+kihGp9hDlenbeFS
> JhQigxP2+U6o9J2GtDKSk2v2+yre01ZWDwPKG0SIU0hvZfIxo2mxjkt2Pze9P7yT
> UC8lNaZ/asL1PQW3+6rWep7Pp4XEYGz929HQdOZFhIoGpzPvVwDVFiJ22bib41SB
> +/oiRWoly2xwwBHN+U30SS2TMsqvBxvXZKb07riK7BeOB/Ep42Wh/LDFw5W0ZKRs
> jDW3to0JaqdcLkBftRKmdJT1zwn/3KcIVWcLioyx/lr+kQpykEfMCeeZ5BWonEWp
> OP86c6ofbwv32h5qkFT4DPRd8tNDFDI8S9UpNnGcmnTMDbJEkA5sIsdgx8AvOGwp
> 5CAr1ME6TeAmmx8yZsCHv2wSkNsuKEAggq5MOW7V3VdS37ChV8TBW86Kl3n2OXn/
> T1s+P1RGg1T0nBUf7bA7zecUmD2urH/HYg/ncoysshA5XjjPQ7g=
> =hvr2
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett

Reply via email to