{"action":"created","issue":{"url":"https://api.github.com/repos/decebals/pf4j/issues/148","repository_url":"https://api.github.com/repos/decebals/pf4j","labels_url":"https://api.github.com/repos/decebals/pf4j/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/decebals/pf4j/issues/148/comments","events_url":"https://api.github.com/repos/decebals/pf4j/issues/148/events","html_url":"https://github.com/decebals/pf4j/issues/148","id":236659235,"number":148,"title":"Can't manage to use slf4j together with plugins","user":{"login":"lyze237","id":11274700,"avatar_url":"https://avatars0.githubusercontent.com/u/11274700?v=3","gravatar_id":"","url":"https://api.github.com/users/lyze237","html_url":"https://github.com/lyze237","followers_url":"https://api.github.com/users/lyze237/followers","following_url":"https://api.github.com/users/lyze237/following{/other_user}","gists_url":"https://api.github.com/users/lyze237/gists{/gist_id}","starred_url":"https://api.github.com/users/lyze237/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyze237/subscriptions","organizations_url":"https://api.github.com/users/lyze237/orgs","repos_url":"https://api.github.com/users/lyze237/repos","events_url":"https://api.github.com/users/lyze237/events{/privacy}","received_events_url":"https://api.github.com/users/lyze237/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-17T12:58:50Z","updated_at":"2017-06-17T13:02:13Z","closed_at":null,"body":"Hello!\r\n\r\nI'm currently trying to use slf4j (over either simple or log4j) and I always get warnings that it found multiple slf4j bindings:\r\n\r\nThe following warning message appears once per plugin, which is a gigantic chunk when I have a couple of them loaded!\r\n\r\n```\r\nSLF4J: Class path contains multiple SLF4J bindings.\r\nSLF4J: Found binding in [jar:file:/C:/Users/lyze/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.5/6edffc576ce104ec769d954618764f39f0f0f10d/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]\r\nSLF4J: Found binding in [jar:file:/D:/Workspace/java/darkowlbot/Core/plugins/DarkOwlBot-TelegramClient-0.0.26/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]\r\nSLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.\r\nSLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]\r\nlog4j:ERROR A \"org.apache.log4j.ConsoleAppender\" object is not assignable to a \"org.apache.log4j.Appender\" variable.\r\nlog4j:ERROR The class \"org.apache.log4j.Appender\" was loaded by \r\nlog4j:ERROR [ro.fortsoft.pf4j.PluginClassLoader@6bc168e5] whereas object of type \r\nlog4j:ERROR \"org.apache.log4j.ConsoleAppender\" was loaded by [sun.misc.Launcher$AppClassLoader@73d16e93].\r\nlog4j:ERROR Could not instantiate appender named \"Console\".\r\nlog4j:ERROR A \"org.apache.log4j.ConsoleAppender\" object is not assignable to a \"org.apache.log4j.Appender\" variable.\r\nlog4j:ERROR The class \"org.apache.log4j.Appender\" was loaded by \r\nlog4j:ERROR [ro.fortsoft.pf4j.PluginClassLoader@6bc168e5] whereas object of type \r\nlog4j:ERROR \"org.apache.log4j.ConsoleAppender\" was loaded by [sun.misc.Launcher$AppClassLoader@73d16e93].\r\nlog4j:ERROR Could not instantiate appender named \"Console\".\r\nlog4j:ERROR A \"org.apache.log4j.ConsoleAppender\" object is not assignable to a \"org.apache.log4j.Appender\" variable.\r\nlog4j:ERROR The class \"org.apache.log4j.Appender\" was loaded by \r\nlog4j:ERROR [ro.fortsoft.pf4j.PluginClassLoader@6bc168e5] whereas object of type \r\nlog4j:ERROR \"org.apache.log4j.ConsoleAppender\" was loaded by [sun.misc.Launcher$AppClassLoader@73d16e93].\r\nlog4j:ERROR Could not instantiate appender named \"Console\".\r\nlog4j:ERROR A \"org.apache.log4j.ConsoleAppender\" object is not assignable to a \"org.apache.log4j.Appender\" variable.\r\nlog4j:ERROR The class \"org.apache.log4j.Appender\" was loaded by \r\nlog4j:ERROR [ro.fortsoft.pf4j.PluginClassLoader@6bc168e5] whereas object of type \r\nlog4j:ERROR \"org.apache.log4j.ConsoleAppender\" was loaded by [sun.misc.Launcher$AppClassLoader@73d16e93].\r\nlog4j:ERROR Could not instantiate appender named \"Console\".\r\nlog4j:WARN No appenders could be found for logger (com.thyllian.DarkOwlBot.plugins.clients.telegram.TelegramPlugin).\r\nlog4j:WARN Please initialize the log4j system properly.\r\nlog4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.\r\n```\r\n\r\n\r\n\r\nLog4j properties inside startup project:\r\n\r\n```\r\nlog4j.rootLogger=DEBUG, Console\r\n\r\n#\r\n# PF4J log\r\n#\r\nlog4j.logger.ro.fortsoft.pf4j=INFO, Console\r\nlog4j.logger.ro.fortsoft.pf4j.PluginClassLoader=WARN, Console\r\nlog4j.additivity.ro.fortsoft.pf4j=false\r\nlog4j.logger.com.thyllian=TRACE, Console\r\n\r\n#\r\n# Appenders\r\n#\r\nlog4j.appender.Console=org.apache.log4j.ConsoleAppender\r\nlog4j.appender.Console.layout=org.apache.log4j.PatternLayout\r\n#log4j.appender.Console.layout.conversionPattern=%-5p - %-32.32c{1} - %m\\n\r\nlog4j.appender.Console.layout.ConversionPattern=%d %p %c - %m%n\r\n```\r\n\r\nEverything works however properly, messages get printed just fine, though multiple times.\r\n\r\nSetup is just:\r\n\r\nmain build.gradle:\r\n```\r\nsubprojects {\r\n    dependencies {\r\n         compile 'ro.fortsoft.pf4j:pf4j:1.3.0'\r\n         compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.5'\r\n    }\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/decebals/pf4j/issues/comments/309213942","html_url":"https://github.com/decebals/pf4j/issues/148#issuecomment-309213942","issue_url":"https://api.github.com/repos/decebals/pf4j/issues/148","id":309213942,"user":{"login":"lyze237","id":11274700,"avatar_url":"https://avatars0.githubusercontent.com/u/11274700?v=3","gravatar_id":"","url":"https://api.github.com/users/lyze237","html_url":"https://github.com/lyze237","followers_url":"https://api.github.com/users/lyze237/followers","following_url":"https://api.github.com/users/lyze237/following{/other_user}","gists_url":"https://api.github.com/users/lyze237/gists{/gist_id}","starred_url":"https://api.github.com/users/lyze237/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyze237/subscriptions","organizations_url":"https://api.github.com/users/lyze237/orgs","repos_url":"https://api.github.com/users/lyze237/repos","events_url":"https://api.github.com/users/lyze237/events{/privacy}","received_events_url":"https://api.github.com/users/lyze237/received_events","type":"User","site_admin":false},"created_at":"2017-06-17T13:02:13Z","updated_at":"2017-06-17T13:02:13Z","body":"When I try to move the slf4j-log4j12 library to the main startup project instead of every project it doesn't compile with the following error:\r\n\r\n```\r\nException in thread \"main\" java.lang.LinkageError: loader constraint violation: when resolving method \"org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;\" the class loader (instance of ro/fortsoft/pf4j/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature\r\n\tat org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:299)\r\n\tat org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)\r\n\tat org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)\r\n\tat com.thyllian.DarkOwlBot.plugins.clients.discord.DiscordPlugin.<clinit>(DiscordPlugin.java:16)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\r\n\tat ro.fortsoft.pf4j.DefaultPluginFactory.create(DefaultPluginFactory.java:64)\r\n\tat ro.fortsoft.pf4j.PluginWrapper.getPlugin(PluginWrapper.java:78)\r\n\tat ro.fortsoft.pf4j.AbstractPluginManager.startPlugins(AbstractPluginManager.java:315)\r\n\tat com.thyllian.darkowlbot.Startup.startup(Startup.java:79)\r\n\tat com.thyllian.darkowlbot.Startup.main(Startup.java:23)\r\n:Core:run FAILED\r\n```"}}
{"actor":{"display_login":"lyze237"}}