users@glassfish.java.net

Re: log4j configured app fails in glassfish v4

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 06 Jan 2010 16:49:26 -0800

On 01/ 6/10 04:23 PM, glassfish_at_javadesktop.org wrote:
>> At what point in your application's lifecycle to you
>> get the above error?
>>
>
> At deploy time, or server startup if the app was already deployed.
>
>
>> Would it be possible for you to supply a simple test
>> case?
>>
>
> I'll see about creating a test case; this occurred with a fairly large, complex app that uses many libraries. One of the libraries also uses commons logging, another uses log4j directly (JAWR). I have a suspicion it's related to one of those.
>

In GlassFish v3, the deployment creates a temporary and a permanent
classloader for every web application. The temporary class loader is
discarded
after the deployment has completed. It is quite possible that the
"Appender" interface was loaded by the temporary class loader and
cached, whereas "ConsoleAppender" was loaded by the permanent
class loader, making a cast impossible.

A similar issue (related to parsers), which manifested itself with this
error message:

  Digester.getParser:
  java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration
  cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration

had been reported prior to the release of v3 and was fixed by clearing any
cached parser and parser factory instances after an app's deployment and
prior
to its startup phase. See
https://glassfish.dev.java.net/issues/show_bug.cgi?id=9894
for details.

It is possible that a similar fix may be needed in the case of logging.

If you could provide a simple test case, that would be much appreciated.

Thanks,

Jan

> [Message sent by forum member 'rwillie6' (ryanwilson.m_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=379147
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>