Java – how to sandbox slf4j

I have an application (extension) running in the smartfox server Most people don't know about smartfox, but the settings are like Tomcat That is, the extension has its own class loader. It first loads classes from the extension and then the global server Library (I will call it selfish class loading, because I don't know the official term, if it exists)

I have a problem with multiple slf4j bindings. My extension includes logback and a server that contains another slf4j binding (useless to me):

INFO   | jvm 1    | 2011/10/06 11:10:25 | SLF4J: Class path contains multiple SLF4J bindings.
INFO   | jvm 1    | 2011/10/06 11:10:25 | SLF4J: Found binding in [jar:file:/opt/smartfox/Server/lib/lsc.jar!/org/slf4j/impl/StaticLoggerBinder.class]
INFO   | jvm 1    | 2011/10/06 11:10:25 | SLF4J: Found binding in [jar:file:/opt/smartfox/Server/wext/smilefish/logback-classic-jar-logback-classic-0.9.29.jar!/org/slf4j/impl/StaticLoggerBinder.class]

I hope selfish class loading can solve this problem, but obviously it doesn't How can I fix this problem without deleting any bindings?

(for the source code of selfish classloader, see is there a Tomcat like classloader that can be used standalone?)

Solution

The output from slf4j is just a warning Loading from the class you described (self / leaf first / local first), slf4j may have bound logback Have you checked it?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>