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

Reply via email to