Javier Armendáriz created LOG4J2-2487:
-----------------------------------------

             Summary: IllegalArgumentException when compiling plugin with 
Eclipse batch compiler
                 Key: LOG4J2-2487
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2487
             Project: Log4j 2
          Issue Type: Bug
          Components: Plugins
    Affects Versions: 2.11.1, 2.10.0, 2.8
         Environment: In order to reproduce this bug, I created [this 
project|https://github.com/katanagari7c1/ecj-error-log4j] with the minimal code 
to test my scenario.

I reproduced this error on a Ubuntu 18.04 and OSX machine. Also tested with 
versions 4.7 and 4.9 of the ECJ and using Java 8, both OpenJDK and Oracle.
            Reporter: Javier Armendáriz


Recently I started using log4j 2 in my project and I created some custom 
appenders and configuration factories using the @Plugin annotation.

It all worked fine and show no errors compiling in Eclipse 4.9 and IntelliJ 
Idea. However, using the Eclipse batch compiler, my code fails with the 
following stacktrace:
{noformat}
Processing annotations
java.lang.IllegalArgumentException: Unknown location : CLASS_OUTPUT
        at 
org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.getFileForOutput(EclipseFileManager.java:436)
        at 
org.eclipse.jdt.internal.compiler.apt.dispatch.BatchFilerImpl.createResource(BatchFilerImpl.java:89)
        at 
org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.writeCacheFile(PluginProcessor.java:117)
        at 
org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.process(PluginProcessor.java:78)
        at 
org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:142)
        at 
org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:124)
        at 
org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:162)
        at 
org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:940)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:450)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
        at 
org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4693)
        at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1781)
        at org.eclipse.jdt.internal.compiler.batch.Main.main(Main.java:1485)
Processing annotations
No elements to process
1. ERROR: Unknown location : CLASS_OUTPUT
1 problem (1 error){noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to