Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Log4j - NTEventLogAppender (Library is already loaded in another ClassLoader)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two applications deployed to the same profile on websphere server, they both need to log information to windows event log using log4j. First, I set up the log4j as a shared library, then reference the shared library from both applications and copy the NTEventLogAppender.dll to the windows\system32. It works well when I use "org.apache.log4j.DailyRollingFileAppender" as appender in the configuration file, I can see the new entry logged in the log file. but after I changed to "org.apache.log4j.nt.NTEventLogAppender", I got the error:

java.lang.UnsatisfiedLinkError: NTEventLogAppender (Library is already loaded in another ClassLoader).

By research on interent, I understand this is because the NTEventLogAppender.dll, as a native dll file, is not controlled by websphere server. To avoid this error, it is my responsibility to ensure the dll is only loaded once. There is also an example on the internet to show how to create an utility JAR file and load the native dll file, then set up it as shared library. But with log4j I have no idea how to do this. I have spent lots of time trying to figure out, but still no luck . Could anyone please advise? Any help will be highly appreciated!
 
author
Posts: 3281
8
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 there and welcome to Javaranch,

I'm afraid I don't have any further knowledge to share, but have you tried the Log4J mailing lists?
 
Hill Xie
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you! I just found the mail list and post a message. (Cross my fingers)
 
reply
    Bookmark Topic Watch Topic
  • New Topic