[
https://issues.apache.org/jira/browse/LOG4J2-2487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Javier Armendáriz updated LOG4J2-2487:
--------------------------------------
Description:
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}
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.
was:
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}
> 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.8, 2.10.0, 2.11.1
> Environment: Ubuntu 18.04 or OSX machine. ECJ version 4.7 or 4.9.
> Java 8, either OpenJDK and Oracle. Reproduced with Log4j 2.8, 2.10.0 and
> 2.11.1.
> Reporter: Javier Armendáriz
> Priority: Major
>
> 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}
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)