• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

log4j:ERROR Attempted to append to closed appender named [A1]

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all

I have some problem with log4j.

I have web-application which worked in glassfish 2.1 and use log4j for logging.

I'm wrote own log4j appender for sending logs to jms queue (activemq).

for configuration log4j i use ServletContextListener.

This working fine, But when I redeploy web-applications I see follows errors, and problem is solved only when I restart the application server.





Listener:



Appender code:



log4j.properties:


what could be the problem? any idea?

Thanks advance.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex and welcome to Javaranch! Hmm ThreadDeath, that's pretty tricky! I'm not 100% sure, but you may want to look at the scope of the variables in your contextInitialised method and also think carefully about whether you need to do any work in your contextDestroyed method..
 
alex matvey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Martijn Verburg, thanks for your response.

I tried call LogManager.shutdown() into contextDestroyed method, but problem not resolved.

If I leave the method close in appender blank then the application redeployed sucessfully.

I think the problem in releasing resources ( connections... ) .
reply
    Bookmark Topic Watch Topic
  • New Topic