tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Tomcat 6 : Warnings at startup
Date Sun, 10 Jun 2012 18:35:06 GMT
2012/6/10 André Warnier <aw@ice-sa.com>:
> Konstantin Kolinko wrote:
>>
>> 2012/6/10 André Warnier <aw@ice-sa.com>:
>>>
>>> No tomcat 5.5 files have been copied to that system (apart from the
>>> webapp).
>>> Here is the complete (edited, comments removed) content of
>>> tomcat6/conf/catalina.properties :
>>>
>>> (...)
>>>
>>> common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/var/lib/tomcat6/common/classes,/var/lib/tomcat6/common/*.jar
>>>
>>> server.loader=${catalina.home}/server/classes,${catalina.home}/server/*.jar,/var/lib/tomcat6/server/classes,/var/lib/tomcat6/server/*.jar
>>>
>>> shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/*.jar,/var/lib/tomcat6/shared/classes,/var/lib/tomcat6/shared/*.jar
>>
>>
>> The above fragment of catalina.properties explains the issue that you
>> are observing.
>>
>> The "common.loader", "server.loader" and "shared.loader" values
>> provide configuration for Common, Server and Shared classloader, as
>> better documented in 5.5 (Tomcat 6 docs not mention Server and Shared
>> ones, but they still do exist):
>>
>> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html#Overview
>>
>> If you look at a fresh copy of Tomcat 6, the values would be:
>>
>> [[[
>>
>> common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
>> server.loader=
>> shared.loader=
>> ]]]
>>
>> The ones that you have in your file are a mix of 5.5 and 6.0 values.
>>
>> ClassLoaderFactory.validateFile() method is called in turn for each
>> value in each of the 3 *.loader options and checks that those values
>> point to an existing place, which is a directory and is readable.
>>
>> In your case,
>>
>>> WARNING: Problem with directory [/usr/share/tomcat6/server/classes],
>>> exists: [false], isDirectory: [false], canRead: [false]
>>
>>
>> it looked for [/usr/share/tomcat6/server/classes] and warned you that
>> the said directory does not exist.
>>
>>
>
> Thank you Konstantin for this very thorough explanation.
>
> So, it looks like my options to make the warnings disappear are
> - either just create these directories (empty) in CATALINA_HOME
> - or modify the tomcat6/conf/catalina.properties file to remove (direct or
> indirect) references to /usr/share/tomcat6/server
>
> As it is now, the file comes from the Tomcat 6 Debian package; I did not
> modify that file.

The file is strange. I wonder whether other configuration files there
have similar inconsistencies.

The good side though is that this error is not fatal. It was intended
more for folks trying to start Tomcat using different user and failing
because of libraries not being readable. (that is why "canRead" value
is included into the message). ;)

> I would imagine that if the Debian package maintainer decided to modify the
> standard file, he had some reason to do that.
>
> Based on your knowledge, do you have an idea as to why the Debian Tomcat 6
> package maintainer may have considered it a good idea to modify the standard
> catalina.properties in the way that he did ?  Could it be to make upgrades
> tomcat 5.5 -> tomcat 6 easier ?
>
> (To me, there seems to be a curious mixture of "symbolic"
> (${catalina.home}/*) and "hardwired" (/var/lib/tomcat6/*) references in the
> Debian version of that file.)

I can imagine that some odd packages (debs, rpms) were installing
their libraries into those folders.

Anyway
- Placing 3rd party libraries into Common classloader without a good
reason is usually a bad idea. It can result in odd dependencies and in
PermGen memory leaks.

- Are you using this Tomcat to run "your own" application or one
provided by Debian folks? If it were my own I would like to make sure
that there were none of unexpected libraries in those classloaders.

Creating the mentioned folders has the only benefit that you can leave
the original configuration file "as is".

Best regards,
Konstantin Kolinko

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


Mime
View raw message