• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Hill Xie
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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!
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you! I just found the mail list and post a message. (Cross my fingers)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic