You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rogerio Baldini das Neves <ro...@powerlogic.com.br> on 2008/02/12 12:17:45 UTC
Tomcat6 classloader problem
Hi,
I am passing through this problem nowadays in Tomcat6:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierarchy. You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.
(Caused by org.apache.commons.logging.LogConfigurationException: Invalid
class loader hierarchy. You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.)
This is my context:
- App1 accessing App2 to start a service, and App2 accessing back
App1 to get some information.
- Problem occurs when App2 is accessing back App1.
I have this configuration in server.xml
<Resource name="jcpbatch/plugin-server"
type="com.powerlogic.jcpbatch.pluginservice.JBatchPluginService"
factory="com.powerlogic.jcpbatch.pluginservice.JBatchPluginServiceFactory"/>
and this one in web.xml:
<resource-env-ref>
<description> JBatchPluginService</description>
<resource-env-ref-name>jcpbatch/plugin-server</resource-env-ref-name>
<resource-env-ref-type>com.powerlogic.jcpbatch.pluginservice.JBatchPluginSer
vice</resource-env-ref-type>
</resource-env-ref>
- Both of them have commons-logging-1.0.4.jar in the WEB-INF/lib
VERY IMPORTANT: It has worked perfectly in Tomcat 5.5.9
Any ideas ?
Thanks
Rogerio Baldini
jCompany Suite - Product Owner
+55 (31) 3555-0050
rogerio.baldini@powerlogic.com.br
Powerlogic S.A.
img
RE: RES: Tomcat6 classloader problem
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rogerio Baldini das Neves
> [mailto:rogerio.baldini@powerlogic.com.br]
> Subject: RES: RES: Tomcat6 classloader problem
>
> Then, the solution is putting the commons-logging jar in tomcat lib
> directory, right ?
Maybe. My preferred choice would be for the shared classes not to use
their own logger, but instead use one passed in by each calling webapp.
> Could it cause some collateral effects in apps which has
> commons-logging jar inside WEB-INF/lib ?
Extremely likely. You should never have the same class in more than one
place in any given branch of the classloader tree.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: RES: Tomcat6 classloader problem
Posted by Rogerio Baldini das Neves <ro...@powerlogic.com.br>.
Then, the solution is putting the commons-logging jar in tomcat lib
directory, right ?
Could it cause some collateral effects in apps which has commons-logging jar
inside WEB-INF/lib ?
Rogerio Baldini
jCompany Suite - Product Owner
+55 (31) 3555-0050
rogerio.baldini@powerlogic.com.br
Powerlogic S.A.
-----Mensagem original-----
De: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
Enviada em: terça-feira, 12 de fevereiro de 2008 13:00
Para: Tomcat Users List
Assunto: RE: RES: Tomcat6 classloader problem
> From: David Delbecq [mailto:delbd+jakarta@oma.be]
> Subject: Re: RES: Tomcat6 classloader problem
>
> From http://tomcat.apache.org/tomcat-6.0-doc/logging.html :
> "Tomcat 6.0 uses Commons Logging
> <http://commons.apache.org/logging> throughout its internal
> code allowing the developer to choose a logging configuration
> that suits their needs,"
That bit of the doc may be out of date (or "no longer operative", as
some politicians would say). I can't find any instances of commons
logging classes in any of the 6.0 jars, whereas the
commons-logging-api.jar was present in the 5.5 releases.
> Could it be this class is exposed to webapps?
Not likely; I wonder if the class the OP put into Tomcat's lib directory
is holding downward references to loggers in one of the webapps, thereby
causing issues when accessed by the other webapp. In 5.5, the logger
reference may have been satisfied by the one provided by Tomcat, which
is no longer there.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.20.2/1273 - Release Date: 12/2/2008
09:31
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: RES: Tomcat6 classloader problem
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: David Delbecq [mailto:delbd+jakarta@oma.be]
> Subject: Re: RES: Tomcat6 classloader problem
>
> From http://tomcat.apache.org/tomcat-6.0-doc/logging.html :
> "Tomcat 6.0 uses Commons Logging
> <http://commons.apache.org/logging> throughout its internal
> code allowing the developer to choose a logging configuration
> that suits their needs,"
That bit of the doc may be out of date (or "no longer operative", as
some politicians would say). I can't find any instances of commons
logging classes in any of the 6.0 jars, whereas the
commons-logging-api.jar was present in the 5.5 releases.
> Could it be this class is exposed to webapps?
Not likely; I wonder if the class the OP put into Tomcat's lib directory
is holding downward references to loggers in one of the webapps, thereby
causing issues when accessed by the other webapp. In 5.5, the logger
reference may have been satisfied by the one provided by Tomcat, which
is no longer there.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: RES: Tomcat6 classloader problem
Posted by David Delbecq <de...@oma.be>.
From http://tomcat.apache.org/tomcat-6.0-doc/logging.html : "Tomcat
6.0 uses Commons Logging <http://commons.apache.org/logging> throughout
its internal code allowing the developer to choose a logging
configuration that suits their needs,"
Could it be this class is exposed to webapps?
En l'instant précis du 12/02/08 13:51, Rogerio Baldini das Neves
s'exprimait en ces termes:
> Hi David,
>
> In truth ,I have a library in tomcat lib directory to communicate both applications. Using the resource:
> <Resource name="jcpbatch/plugin-server"
> type="com.powerlogic.jcpbatch.pluginservice.JBatchPluginService"
> factory="com.powerlogic.jcpbatch.pluginservice.JBatchPluginServiceFactory"/>
>
> There are 2 'org.apache.commons.logging.Log' visible. One in app1 and another in app2.
> But no one in tomcat lib directory. I don't want to put in there because of possible collateral effects with others apps.
>
> The message received doesn't come from tomcat but from commons-logging, that is the same used in Tomcat 5.5.9.
>
> Isn't it correct that Tomcat should have kept compatibility in this case.
> Theorically everything working in Tomcat 5.5.x should work in Tomcat 6.x, or am I wrong ?
>
>
> Thanks a lot,
>
> Rogerio Baldini
> jCompany Suite - Product Owner
> +55 (31) 3555-0050
> rogerio.baldini@powerlogic.com.br
> Powerlogic S.A.
>
>
>
> -----Mensagem original-----
> De: David Delbecq [mailto:delbd+jakarta@oma.be]
> Enviada em: terça-feira, 12 de fevereiro de 2008 09:20
> Para: Tomcat Users List
> Assunto: Re: Tomcat6 classloader problem
>
> Root of your problem is that: "You have more than one version of
> 'org.apache.commons.logging.Log' visible"
>
> You say app1 access app2 which access back app1. Webapps in a container
> should not be able to see each other's classes. Can you tell us which
> method you used to have those 2 webapps see each other? That could
> explain why there is 2 Log visible in classloader. Also, it may be that
> the message comes from commons-logging provided with tomcat, which may
> not be the same as the one in tomcat 5.5.9. So it may be that the mixup
> problem was already there but unnoticed in tomcat 5.5.9
>
>
>
> En l'instant précis du 12/02/08 12:17, Rogerio Baldini das Neves
> s'exprimait en ces termes:
>
>> Hi,
>>
>>
>>
>> I am passing through this problem nowadays in Tomcat6:
>>
>>
>>
>> org.apache.commons.logging.LogConfigurationException:
>> org.apache.commons.logging.LogConfigurationException:
>>
>> Invalid class loader hierarchy. You have more than one version of
>> 'org.apache.commons.logging.Log' visible, which is not allowed.
>>
>> (Caused by org.apache.commons.logging.LogConfigurationException:
>> Invalid class loader hierarchy. You have more than one version of
>> 'org.apache.commons.logging.Log' visible, which is not allowed.)
>>
>>
>>
>> This is my context:
>>
>> - App1 accessing App2 to start a service, and App2 accessing
>> back App1 to get some information.
>>
>> - Problem occurs when App2 is accessing back App1.
>>
>> I have this configuration in server.xml
>>
>> <Resource name="jcpbatch/plugin-server"
>>
>>
>> type="com.powerlogic.jcpbatch.pluginservice.JBatchPluginService"
>>
>>
>> factory="com.powerlogic.jcpbatch.pluginservice.JBatchPluginServiceFactory"/>
>>
>>
>>
>> and this one in web.xml:
>>
>> <resource-env-ref>
>>
>> <description> JBatchPluginService</description>
>>
>>
>> <resource-env-ref-name>jcpbatch/plugin-server</resource-env-ref-name>
>>
>>
>> <resource-env-ref-type>com.powerlogic.jcpbatch.pluginservice.JBatchPluginService</resource-env-ref-type>
>>
>>
>> </resource-env-ref>
>>
>>
>>
>> - Both of them have commons-logging-1.0.4.jar in the WEB-INF/lib
>>
>>
>>
>> VERY IMPORTANT: It has worked perfectly in Tomcat 5.5.9
>>
>>
>>
>> Any ideas ?
>>
>> Thanks
>>
>>
>>
>>
>>
>> Rogerio Baldini
>>
>> jCompany Suite - Product Owner
>>
>> +55 (31) 3555-0050
>>
>> rogerio.baldini@powerlogic.com.br
>> <ma...@powerlogic.com.br>
>>
>> Powerlogic S.A.
>>
>>
>>
>> img
>>
>>
>>
>>
>
>
>
--
http://www.devlog.be (a belgian developer's logs)
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RES: Tomcat6 classloader problem
Posted by Rogerio Baldini das Neves <ro...@powerlogic.com.br>.
Hi David,
In truth ,I have a library in tomcat lib directory to communicate both applications. Using the resource:
<Resource name="jcpbatch/plugin-server"
type="com.powerlogic.jcpbatch.pluginservice.JBatchPluginService"
factory="com.powerlogic.jcpbatch.pluginservice.JBatchPluginServiceFactory"/>
There are 2 'org.apache.commons.logging.Log' visible. One in app1 and another in app2.
But no one in tomcat lib directory. I don't want to put in there because of possible collateral effects with others apps.
The message received doesn't come from tomcat but from commons-logging, that is the same used in Tomcat 5.5.9.
Isn't it correct that Tomcat should have kept compatibility in this case.
Theorically everything working in Tomcat 5.5.x should work in Tomcat 6.x, or am I wrong ?
Thanks a lot,
Rogerio Baldini
jCompany Suite - Product Owner
+55 (31) 3555-0050
rogerio.baldini@powerlogic.com.br
Powerlogic S.A.
-----Mensagem original-----
De: David Delbecq [mailto:delbd+jakarta@oma.be]
Enviada em: terça-feira, 12 de fevereiro de 2008 09:20
Para: Tomcat Users List
Assunto: Re: Tomcat6 classloader problem
Root of your problem is that: "You have more than one version of
'org.apache.commons.logging.Log' visible"
You say app1 access app2 which access back app1. Webapps in a container
should not be able to see each other's classes. Can you tell us which
method you used to have those 2 webapps see each other? That could
explain why there is 2 Log visible in classloader. Also, it may be that
the message comes from commons-logging provided with tomcat, which may
not be the same as the one in tomcat 5.5.9. So it may be that the mixup
problem was already there but unnoticed in tomcat 5.5.9
En l'instant précis du 12/02/08 12:17, Rogerio Baldini das Neves
s'exprimait en ces termes:
>
> Hi,
>
>
>
> I am passing through this problem nowadays in Tomcat6:
>
>
>
> org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException:
>
> Invalid class loader hierarchy. You have more than one version of
> 'org.apache.commons.logging.Log' visible, which is not allowed.
>
> (Caused by org.apache.commons.logging.LogConfigurationException:
> Invalid class loader hierarchy. You have more than one version of
> 'org.apache.commons.logging.Log' visible, which is not allowed.)
>
>
>
> This is my context:
>
> - App1 accessing App2 to start a service, and App2 accessing
> back App1 to get some information.
>
> - Problem occurs when App2 is accessing back App1.
>
> I have this configuration in server.xml
>
> <Resource name="jcpbatch/plugin-server"
>
>
> type="com.powerlogic.jcpbatch.pluginservice.JBatchPluginService"
>
>
> factory="com.powerlogic.jcpbatch.pluginservice.JBatchPluginServiceFactory"/>
>
>
>
> and this one in web.xml:
>
> <resource-env-ref>
>
> <description> JBatchPluginService</description>
>
>
> <resource-env-ref-name>jcpbatch/plugin-server</resource-env-ref-name>
>
>
> <resource-env-ref-type>com.powerlogic.jcpbatch.pluginservice.JBatchPluginService</resource-env-ref-type>
>
>
> </resource-env-ref>
>
>
>
> - Both of them have commons-logging-1.0.4.jar in the WEB-INF/lib
>
>
>
> VERY IMPORTANT: It has worked perfectly in Tomcat 5.5.9
>
>
>
> Any ideas ?
>
> Thanks
>
>
>
>
>
> Rogerio Baldini
>
> jCompany Suite - Product Owner
>
> +55 (31) 3555-0050
>
> rogerio.baldini@powerlogic.com.br
> <ma...@powerlogic.com.br>
>
> Powerlogic S.A.
>
>
>
> img
>
>
>
--
http://www.devlog.be (a belgian developer's logs)
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.20.2/1271 - Release Date: 11/2/2008 08:16
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat6 classloader problem
Posted by David Delbecq <de...@oma.be>.
Root of your problem is that: "You have more than one version of
'org.apache.commons.logging.Log' visible"
You say app1 access app2 which access back app1. Webapps in a container
should not be able to see each other's classes. Can you tell us which
method you used to have those 2 webapps see each other? That could
explain why there is 2 Log visible in classloader. Also, it may be that
the message comes from commons-logging provided with tomcat, which may
not be the same as the one in tomcat 5.5.9. So it may be that the mixup
problem was already there but unnoticed in tomcat 5.5.9
En l'instant précis du 12/02/08 12:17, Rogerio Baldini das Neves
s'exprimait en ces termes:
>
> Hi,
>
>
>
> I am passing through this problem nowadays in Tomcat6:
>
>
>
> org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException:
>
> Invalid class loader hierarchy. You have more than one version of
> 'org.apache.commons.logging.Log' visible, which is not allowed.
>
> (Caused by org.apache.commons.logging.LogConfigurationException:
> Invalid class loader hierarchy. You have more than one version of
> 'org.apache.commons.logging.Log' visible, which is not allowed.)
>
>
>
> This is my context:
>
> - App1 accessing App2 to start a service, and App2 accessing
> back App1 to get some information.
>
> - Problem occurs when App2 is accessing back App1.
>
> I have this configuration in server.xml
>
> <Resource name="jcpbatch/plugin-server"
>
>
> type="com.powerlogic.jcpbatch.pluginservice.JBatchPluginService"
>
>
> factory="com.powerlogic.jcpbatch.pluginservice.JBatchPluginServiceFactory"/>
>
>
>
> and this one in web.xml:
>
> <resource-env-ref>
>
> <description> JBatchPluginService</description>
>
>
> <resource-env-ref-name>jcpbatch/plugin-server</resource-env-ref-name>
>
>
> <resource-env-ref-type>com.powerlogic.jcpbatch.pluginservice.JBatchPluginService</resource-env-ref-type>
>
>
> </resource-env-ref>
>
>
>
> - Both of them have commons-logging-1.0.4.jar in the WEB-INF/lib
>
>
>
> VERY IMPORTANT: It has worked perfectly in Tomcat 5.5.9
>
>
>
> Any ideas ?
>
> Thanks
>
>
>
>
>
> Rogerio Baldini
>
> jCompany Suite - Product Owner
>
> +55 (31) 3555-0050
>
> rogerio.baldini@powerlogic.com.br
> <ma...@powerlogic.com.br>
>
> Powerlogic S.A.
>
>
>
> img
>
>
>
--
http://www.devlog.be (a belgian developer's logs)
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org