Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039557
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Tools] Othersmajoralways2018-10-29 16:422018-11-08 09:56
ReporterjarmendarizView Statuspublic 
Assigned Tojarmendariz 
PrioritynormalResolutionfixed 
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnone 
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Review Assigned Toalostale
Summary

0039557: Eclipse warnings task fails when processing log4j annotations

DescriptionThe project compiles without errors in Eclipse IDE. However, using the ecj batch compiler in the eclipse-warnings task it fails in the annotation processing step with the following message:

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)

This issue has already been reported in:
- Stack Overflow: https://stackoverflow.com/questions/52998733/ecj-fails-with-illegalargumentexception-processing-log4j-annotations [^]
- Log4j Jira: https://issues.apache.org/jira/browse/LOG4J2-2487 [^]
- Eclipse issue tracker: https://bugs.eclipse.org/bugs/show_bug.cgi?id=540569 [^]
Steps To ReproduceThe following repository contains a minimal scenario to reproduce this issue:

https://github.com/katanagari7c1/ecj-error-log4j [^]

Just clone this repository and execute run-ecj.sh.
Proposed SolutionUntil either Eclipse/Apache comes with a patch to solve this issue, log4j's annotation processor can be skipped in batch build by removing META-INF/services/javax.annotation.processing.Processor in log4j-core-x.y.z.jar.

This should be done only in eclipse-warnings task.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0039504 closedjarmendariz Openbravo ERP Upgrade Log4j to version 2 

-  Notes
(0107658)
jarmendariz (developer)
2018-10-30 14:28

Repository: ci/eclipse-warnings
Changeset: ada4fd8fd3c2
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Mon, 29 Oct 2018 17:24:08 +0100
URL: https://code.openbravo.com/tools/ci/eclipse-warnings/rev/ada4fd8fd3c2 [^]

Fixed issue 39557: Ecj fails when processing log4j annotations

This replaces the log4j-core library in the classpath with a customized jar with
no annotation processing as a workaround until this bug is solved. Also wrapped all
js code in CDATA tags to avoid problems with the && operator.

---
M build-eclipse.xml
A log4j-core-2.11.1.jar
---

- Issue History
Date Modified Username Field Change
2018-10-29 16:42 jarmendariz New Issue
2018-10-29 16:44 jarmendariz Relationship added related to 0039504
2018-10-29 16:45 jarmendariz Assigned To => jarmendariz
2018-10-29 16:45 jarmendariz Status new => scheduled
2018-10-30 14:28 jarmendariz Note Added: 0107658
2018-10-30 14:28 jarmendariz Status scheduled => resolved
2018-10-30 14:28 jarmendariz Resolution open => fixed
2018-10-30 14:29 jarmendariz Review Assigned To => alostale
2018-11-08 09:56 alostale Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker