commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <>
Subject Re: [logging] Invalid class loader hierarchy w/Ant+Hibernate+Logging (or the case of the unseen Log spectre)
Date Tue, 24 Aug 2004 07:34:24 GMT
On Mon, 23 Aug 2004 13:16:57 -0400, Brian Lee Yung Rowe
<> wrote:
> Hi:
> I'm using commons logging with Ant and Hibernate and am getting a class loader
> error which has me scratching my head. I'm sending to this list as I believe
> it to be a configuration issue with Logging as opposed to Hibernate. Evidence
> otherwise is certainly welcome.
> First some background: I'm trying to run Hibernate's schema export taskdef via
> Ant. The versions of salient libraries are below:
> Ant 1.6.1
> Commons-Logging 1.0.4
> Log4J 1.2.8
> Hibernate 2.1
> This is the error I'm getting:
> --- Nested Exception ---
> java.lang.ExceptionInInitializerError
>         at
> net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(
>         at
> net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(
> ....
> Caused by: 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.

This message means what it says.

If you have more than one version of org.apache.commons.logging.Log
visible in the class path, you are pretty much guaranteed to have
class loading issues, so the Commons Logging code tries to identify
and catch this case as early as possible.

When using Ant, I've found that it is almost always necessary to use a
separate process for the actual application you are trying to run
(such as using fork="true" on a <java> task), to avoid conficts
between Ant's internal class loader (which includes, for example,
everything in $ANT_HOME/lib) and the class path you have specified for
that particular target.

But there's no way to know what is actually going on for you, without
more details about the Ant targets you are trying to execute.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message