Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2487

IllegalArgumentException when compiling plugin with Eclipse batch compiler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8, 2.10.0, 2.11.1
    • None
    • Plugins
    • None
    • 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.

    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:

      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)
      
      

      In order to reproduce this bug, I created this project with the minimal code to test my scenario.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jarmendariz Javier Armendáriz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: