Raivo,

Please don't email directly. Use the mailing list instead. (Apologies if
I emailed both you AND the list.)

On 10/6/20 14:59, Raivo Rebane wrote:
> How I undrestand is that these files is added to tomcat common classpath
> or does there are several classpaths ?

In Java there can be many ClassLoaders. Each ClassLoader has a
"classpath" of sorts: a list of places where it can load classes. The
word "classpath" is usually reserved for the classpath handed to the JVM
when it launches.

> if I add following line into catalina.properties file:
>
> shared.loader="/opt/tomcat/latest/lib/*.jar"
> Nothing changes

Nothing you add or remove from catlaina.properties will change what is
shown when you run "ps" and look at the command-line used to launch the JVM.

Fortunately, it doesn't matter. Tomcat will configure the "common" and
"shared" ClassLoaders with the correct list of JARs you specify in
catalina.properties, and those libraries will be available to the server
and/or your application(s). The fact that they are not in the "ps"
output for "-classpath [stuff]" does not matter.

-chris

> On 06.10.20 21:36, Christopher Schultz wrote:
>> Raivo,
>>
>> On 10/6/20 12:27, Raivo Rebane wrote:
>>> Hello
>>>
>>> I have following line in catalina.properties file where I want to add
>>> /opt/tomcat/latest/lib/*.jar to classpath
>>>
>>> But If I start Tomcat9 no jars appear in classpath.
>> Which classpath?
>>
>>> and line in catalina.properties is following:
>>>
>>> common.loader="/opt/tomcat/latest/lib/*.jar","/opt/tomcat/latest/bin/*.jar"
>>>
>>>
>>> Tomcat runs without a;most jars
>>>
>>> 21307 ?        Sl     0:02 /usr/lib/jvm/default-java/bin/java
>>> -Djava.util.logging.config.file=/opt/tomcat/latest/conf/logging.properties
>>>
>>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>>> -Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true
>>> -Djdk.tls.ephemeralDHKeySize=2048
>>> -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
>>> -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xms512M
>>> -Xmx1024M -server -XX:+UseParallelGC -Dignore.endorsed.dirs= -classpath
>>> /opt/tomcat/latest/bin/bootstrap.jar:/opt/tomcat/latest/bin/tomcat-juli.jar
>>>
>>> -Dcatalina.base=/opt/tomcat/latest -Dcatalina.home=/opt/tomcat/latest
>>> -Djava.io.tmpdir=/opt/tomcat/latest/temp
>>> org.apache.catalina.startup.Bootstrap start
>> Are you talking about the -classpath specified in the JVM launch? This
>> is entirely expected.
>>
>> Once Tomcat starts up, another ClassLoader is initialized with the JAR
>> files in common.loader in it. You won't see that on the command-line.
>>
>>> The list of directory /opt/tomcat/latest/lib/*.jar is here:
>>>
>>> -rw-r-x--- 1 tomcat tomcat   13342 sept  10 11:23
>>> /opt/tomcat/latest/lib/annotations-api.jar*
>>> -rw-r-x--- 1 tomcat tomcat   54652 sept  10 11:23
>>> /opt/tomcat/latest/lib/catalina-ant.jar*
>>> -rw-r-x--- 1 tomcat tomcat  124406 sept  10 11:23
>>> /opt/tomcat/latest/lib/catalina-ha.jar*
>>> -rw-r-x--- 1 tomcat tomcat 1699600 sept  10 11:23
>>> /opt/tomcat/latest/lib/catalina.jar*
>>> -rw-r-x--- 1 tomcat tomcat   63246 sept  10 11:23
>>> /opt/tomcat/latest/lib/catalina-ssi.jar*
>>> -rw-r-x--- 1 tomcat tomcat   78788 sept  10 11:23
>>> /opt/tomcat/latest/lib/catalina-storeconfig.jar*
>>> -rw-r-x--- 1 tomcat tomcat  347015 sept  10 11:23
>>> /opt/tomcat/latest/lib/catalina-tribes.jar*
>>> -rw-r-x--- 1 tomcat tomcat 2989263 sept  10 11:23
>>> /opt/tomcat/latest/lib/ecj-4.15.jar*
>>> -rw-r-x--- 1 tomcat tomcat   91104 sept  10 11:23
>>> /opt/tomcat/latest/lib/el-api.jar*
>>> -rw-r-x--- 1 tomcat tomcat  171308 sept  10 11:23
>>> /opt/tomcat/latest/lib/jasper-el.jar*
>>> -rw-r-x--- 1 tomcat tomcat  564673 sept  10 11:23
>>> /opt/tomcat/latest/lib/jasper.jar*
>>> -rw-r-x--- 1 tomcat tomcat   28549 sept  10 11:23
>>> /opt/tomcat/latest/lib/jaspic-api.jar*
>>> -rw-r-x--- 1 tomcat tomcat   63811 sept  10 11:23
>>> /opt/tomcat/latest/lib/jsp-api.jar*
>>> -rw-r-x--- 1 tomcat tomcat  283767 sept  10 11:23
>>> /opt/tomcat/latest/lib/servlet-api.jar*
>>> -rw-r-x--- 1 tomcat tomcat   11649 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-api.jar*
>>> -rw-r-x--- 1 tomcat tomcat  908183 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-coyote.jar*
>>> -rw-r-x--- 1 tomcat tomcat  322469 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-dbcp.jar*
>>> -rw-r-x--- 1 tomcat tomcat   69258 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-cs.jar*
>>> -rw-r-x--- 1 tomcat tomcat   75197 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-de.jar*
>>> -rw-r-x--- 1 tomcat tomcat  104921 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-es.jar*
>>> -rw-r-x--- 1 tomcat tomcat  165365 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-fr.jar*
>>> -rw-r-x--- 1 tomcat tomcat  187546 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-ja.jar*
>>> -rw-r-x--- 1 tomcat tomcat  188011 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-ko.jar*
>>> -rw-r-x--- 1 tomcat tomcat   50041 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-pt-BR.jar*
>>> -rw-r-x--- 1 tomcat tomcat   38857 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-ru.jar*
>>> -rw-r-x--- 1 tomcat tomcat  171815 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-i18n-zh-CN.jar*
>>> -rw-r-x--- 1 tomcat tomcat  149747 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-jdbc.jar*
>>> -rw-r-x--- 1 tomcat tomcat   36339 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-jni.jar*
>>> -rw-r-x--- 1 tomcat tomcat  196936 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-util.jar*
>>> -rw-r-x--- 1 tomcat tomcat  224527 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-util-scan.jar*
>>> -rw-r-x--- 1 tomcat tomcat  232989 sept  10 11:23
>>> /opt/tomcat/latest/lib/tomcat-websocket.jar*
>>> -rw-r-x--- 1 tomcat tomcat   39727 sept  10 11:23
>>> /opt/tomcat/latest/lib/websocket-api.jar*
>>>
>>> Looking forwrd
>> These JAR files should be visible to the "common" ClassLoader you have
>> defined.
>>
>> It sounds like you are having some other problem and have decided it is
>> a problem with the classpath. Instead of debugging the "classpath
>> problem", why not describe the actual problem you are having?
>>
>> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>

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

Reply via email to