Is the library containing your custom layout class in the same classloader as Log4j? For instance, did you used to package your custom layout and log4j.jar in WEB-INF/lib, but now have removed log4j.jar from WEB-INF/lib and host it in common/lib. In this situation, Log4j would not be able to to use your custom layout because it's in a classloader it can't see. This could also occur if you put Log4j.jar and your custom layout in common/lib and then your custom layout also in WEB-INF/lib, but not log4j.jar.

The main thing to remember is, put any Log4j dependencies (compile or runtime) alongside log4j.jar. If you have log4j.jar in common/lib, then also put your custom layout there. If, in addition to the latter, you have either Log4j.jar or your custom layout in WEB-INF/lib, make sure both exist there.

Jake


On Fri, 5 Oct 2007 01:01:20 -0700 (PDT)
 Zmaj <[EMAIL PROTECTED]> wrote:

Hello,

since today we have all ogf a sudden a curious problem when trying to deploy
our app in tomcat.
The deploy fails and the logfile shows this error:

log4j:ERROR A "de.mun.support.log.MunHTMLLayout" object is not assignable to
a "org.apache.log4j.Layout" variable.
log4j:ERROR The class "org.apache.log4j.Layout" was loaded by log4j:ERROR [WebappClassLoader
 delegate: false
 repositories:
   /WEB-INF/classes/
----------> Parent Classloader:
[EMAIL PROTECTED]
] whereas object of type log4j:ERROR "de.mun.support.log.MunHTMLLayout" was loaded by
[WebappClassLoader
 delegate: false
 repositories:
   /WEB-INF/classes/
----------> Parent Classloader:
[EMAIL PROTECTED]
].
log4j:ERROR No layout set for the appender named [HTML].

The strange thing about this is that we never had problems with
our own layout before and no idea what is responsible for this.
Any help would be great.
thanks
ivan


--
View this message in context: http://www.nabble.com/object-is-not-assignable-to-a-%22org.apache.log4j.Layout%22-tf4573650.html#a13055048
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to