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ÊHlog4j-plugin-load-issue/PKœÉH¯©Ý6)log4j-plugin-load-issue/defaultFilter.jar}’}0ÓÇÆP–äF^ïLd„aw•båÝ,?kە1¬¢yi¦œ‰R·Ã8·6Ynt-én^¦[Ñ¡ãvsÊu%o#jËfŽ”·ÕvW¡»ú>÷½çž»ç¾ß>xœ¾066zøáÀÁ
 2„àCQ‘ 64„HòŒÕÀr¤dèÎÃsdÎÃM*n#x¢§çfæ 
gdÜZQÙj#¬µÞ.@ýU`¥5’EGS.‘³©ôÐ*BóL¢’³²ª    CéDo3iGJDV_6aîâ¬*lEXÜH%f©
÷¥}ϳ³“žë 
áKzyðąXK"ËNu©}Y*ù¾QŽš¨²kÖ¾L—FÖÅâëÒ£ê@žÏ^XT;Ö#[bªΓéöa-Gm 
É"´Hª>n’ŒLÃ9O˜0óžžL@.(Ê%~–©HA/~ç<      
ö‘M×¼,¸]¤S1[ϳg‹`ešÅ™\n2—˜’ÿˆ£Ä»£îÒ^ª 
ݾ7ñÑ£Ë%·™Ðl¦@m«ûð¬²ipSm{³•eß´UO£¹¾Žpc„¹*Ŝ˜³òkYí6NUµÄܖ‘Ž„oWÌÇø÷ò™P¦âvMÕ»/ê›Îր÷)lXãbâŠBbKŸ
 ù°
Þ ÀëDô
Âûx/h9'•e„Wuã1ä¡œîæµýI®³ˆ 
½•yDôcð£ì|ßz¡¨RgS’Y¶h†Ã    ªX%ˆÙ«cv§¯»/w!LòÁÏü°
ª´ySK÷>ö©È}ŒqD<ß_hxNÞô@&ä|åWß2r‹ïÁH2gý®jžD4MOÀìVrYªôã=q,†8«ˆAÞ!Û§ùå¾_ߣC†$ªÍQêÀо=ئòN¿¨Ü¥0ú;e½
V»Èÿƒê~ 
Ú)Õn.DwýPK‡LÊHÚ<¸ô"log4j-plugin-load-issue/log4j2.xmlUPÍjÃ0
¾úBcÚí¶CÒ26Bí6ší4v0‰bÂ;ØNY{÷É&Å«.æ“ôýXÅö{Pp"ëz£K¼]Ý 
nLÛkYâû[•ßáv³\Fw½œ¬ð¼Î?¹½
!Œ¢ù’BƒœGÞ_.Šûq$ݲö†!WqFh1P‰3Â8óGêĤ|Õ+Ovú¯ÂsCïÅÙLžÝâ´YûsæÊ‡¼ma·Ë‡!wnU×õ/|dÊHIö
 St"Åïàd¦ñ¢[¬çŒºN[ì=E?ã!
•øô\½üK}!©K]úXr
ìÙ&éÆé¨ñjPKÆMÊHlog4j-plugin-load-issue/test/PKàLÊH-™+)¨/log4j-plugin-load-issue/test/DefaultFilter.java¥QMKÄ0=»°ÿaè©-’“·"¬¨{õ¤é4M“’LW‹øß~¬¼,˜C†É¼yïÍd»é¥z—0RµÝl7¦ë}
 ðAÉÅ
ëµ6NOñêM(P<x}DGՙxå]k´èíÀ•(žæø¯æ½TäÃx.Gk,a7u¤Àû9çÝ-|¹“Â5dwØÊÁ®ˆì”$Ô¬4Õn™ŠŸÐbÇÿŽýÜÑ.Ђ—9ÔÖ(PVÆ
  à'¡k"¤àk²|vGÁ4¸¤+Ó3F¦€E!?mpºnž±/c$ì„HôÁ8².ÏʲL
d„ÑAÀiI
²¢b†åð3
ÁAzÞÓ*8ëœ@ß¿V“HüF’Ä!UV¬H¸$9»þ£éð#mÉM¾~PKELÊH?HŸZò„,log4j-plugin-load-issue/test/PluginTest.javaUP=O1
¯RÿƒuÓݒ‰­|@%$H°!†4uҔ\%>
BüwâÜñÑÁ¶üüދã(Õ«4„™VËÅra‡AHFd§Oöâ6ƒi-…
ôQ)qÜ8«@9™3<¸ÑXÿTäðÉÃfžf’TÊ[°[¤õÝ#%ëÍóÈdr´Kááú]a$<«›†c"Nöwr@8ƒ–×W¨åèhmajW̽dÒéÅ9è
Ö¶ðk:$Öw¿N}ÕÜoö¨hVò?©ðx¸ñeu¯°›ØG'iº¿¿‹úF/¬×¡kcÅçé0ú-ü´QÒ®eçâûʤoPK?íMÊH$log4j-plugin-load-issue/
 °üÚSìÂѰüÚSìÂÑP   ìÂÑPK?œÉH¯©Ý6)$ 
6log4j-plugin-load-issue/defaultFilter.jar
 Ûû¬uÂÑ©ðú¬uÂÑ©ðú¬uÂÑPK?‡LÊHÚ<¸ô"$ 
Zlog4j-plugin-load-issue/log4j2.xml
 
€™ðÃêÂÑ@‘ö'ìÂÑ@‘ö'ìÂÑPK?ÆMÊH$Žlog4j-plugin-load-issue/test/
 pwù'ìÂÑpwù'ìÂѐT÷'ìÂÑPK?àLÊH-™+)¨/$ 
Élog4j-plugin-load-issue/test/DefaultFilter.java
 0Ã,&ëÂÑ {÷'ìÂÑ {÷'ìÂÑPK?ELÊH?HŸZò„,$ 
?log4j-plugin-load-issue/test/PluginTest.java
 p,yêÂÑpwù'ìÂÑpwù'ìÂÑPKÇ{
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to