The first log file was obtained for the real plugin (which has dependency to some code that I can't publish), the "test" package is a minimal example I made after my first mail to reproduce the issue. I didn't copy/paste the log file again, but I had this message when the jar in the classpath "*2016-06-09 19:40:44,823 main DEBUG Took 0,001222 seconds to load 0 plugins from package test*" (and the plugin is correctly loaded with the source in eclipse)
Using the "packages" property was the simplest solution for me while trying to test my plugin. I will try to generate the .dat file to make it works. As requested, please find a complete example (config file, application and plugin sources, and plugin as a jar without the .dat file) in the attached zip. You will need to remove the fake txt extension, zip files are blocked on my email address ... Let me know if I should open a JIRA ticket for this Regards, Anthony 2016-06-09 21:53 GMT+02:00 Ralph Goers <ralph.go...@dslextreme.com>: > Your jar does not have the Log4j2Plugins.dat file in it which indicates > the log4j annotation processor did not run. You really should have this > enabled. Although specifying the packages attribute should work it is much > slower to find the plugins. Your log file below show package > com.***.util.logging.log4j as being searched, not test. > > Can you create a zip file with all the parts, with source, that shows the > problem? Doing this piecemeal is a bit tough. > > Ralph > > > On Jun 9, 2016, at 10:47 AM, Anthony Maire <maire.anth...@gmail.com> > wrote: > > > > I made a simplified example (cf attached files) > > My log4j2.xml starts with: > > <Configuration status="trace" packages="test"> > > > > And my application main method with : > > > > String className = "test.DefaultFilter"; > > Class<?> filterClass = Class.forName(className); > > Object filter = filterClass.newInstance(); > > > > (and it does not fail) > > > > => With the .java file in eclipse, the plugin is correctly loaded, but > with the jar file in the classpath only, no plugin is loaded > > > > > > > > > > 2016-06-09 18:54 GMT+02:00 Ralph Goers <ralph.go...@dslextreme.com > <mailto:ralph.go...@dslextreme.com>>: > > We would have to see the plugin to see if it is annotated correctly. > > > > Ralph > > > > > On Jun 9, 2016, at 9:49 AM, Anthony Maire <maire.anth...@gmail.com > <mailto:maire.anth...@gmail.com>> wrote: > > > > > > Hello > > > > > > I'm trying to test some custom filters/layout with an existing > application. > > > When I use them in a dummy test application launched from eclipse, > > > everything if fine, they are correctly loaded if I specify a "packages" > > > property in the configuration > > > > > > However, when packaging the plugin classes in a jar file to run with > the > > > real applications, they are not loaded, cf this log with status="trace" > > > > > > > > > I made another test: I removed the plugins source from my eclipse, and > run > > > the dummy application that was working with the jar file in the > classpath, > > > the plugins are not loaded too. I made sure that the jar is in the > > > classpath: the dummy application starts with a Class.forName() on one > of > > > the plugin classes and it does succeed ... > > > > > > 2016-06-09 17:50:18,488 main DEBUG Installed script engines > > > 2016-06-09 17:50:23,998 main DEBUG Oracle Nashorn Version: 1.8.0_45, > > > Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: > > > {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, > ecmascript} > > > 2016-06-09 17:50:24,013 main DEBUG Took 0,007874 seconds to load 0 > plugins > > > from package com.***.util.logging.log4j > > > > > > > > > Any idea ? > > > > > > Regards, > > > Anthony > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > <mailto:log4j-user-unsubscr...@logging.apache.org> > > For additional commands, e-mail: log4j-user-h...@logging.apache.org > <mailto:log4j-user-h...@logging.apache.org> > > > > > > <defaultFilter.jar> > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > > For additional commands, e-mail: log4j-user-h...@logging.apache.org > >
PK íMÊH log4j-plugin-load-issue/PK ÂÉH¯©Ý 6 ) log4j-plugin-load-issue/defaultFilter.jar}}0ÓÇÆPäF^ïLdawbåÝ,?kÛ1¬¢yi¦R·Ã8·6Ynt-én^¦[Ñ¡ãvsÊu%o#jËf·ÕvW¡»ú>÷½ç»ç¾ß>x¾066zøáÀÁ 2àCQ 64HòÕÀr¤dèÎÃsdÎÃM*n#x¢§çfæ gdÜZ QÙj#¬µÞ.@ýU`¥5EGS.³©ôÐ*BóL¢³²ª CéDo3iGJDV_6aîâ¬*lEXÜH%f© ÷¥}ϳ³Âë áKzyðÄ XK"ËNu©}Y*ù¾Q¨²kÖ¾LFÖÅâëÒ£ê@Ï^XT;Ö#[bªÎéöa-Gm É"´Hª>nLÃ9O0óL@.(Ê%~©HA/~ç< öM×¼,¸]¤S1[óg`eÅ\n2Âÿ£Ä»£îÒ^ª ݾ7ñÑ£Ë%·Ðl¦@m «ûð¬²ipSm{³eß´UO£¹¾pc¹*ųòkYí6NUµÄÜoWÌÇø÷òP¦âvMÕ»/êÎÖ÷)lXãbâBbK ù° Þ ÀëDô Âûx/h9'eWuã1ä¡îæµýI®³ ½yDôcð£ì|ßz¡¨RgSY¶hà ªX%Ù«cv§¯»/w!LòÁÏü° ª´ySK÷>ö©È}qD<ß_hxNÞô@&ä|åWß2rïÁH2gý®jD4MOÀìVrYªôã=q,8«AÞ!Û§ùå¾_ߣC$ªÍQêÀ¾=ئòN¿¨Ü¥0ú;e½ V»Èÿê~ Ú)Õn.DwýPK LÊHÚ<¸ô "