compiler-errors - java.lang.IllegalStateException : endPosTable already set

标签 compiler-errors java-8 maven-2 dagger-2

试图建立一个 alexa (amazon:echo) 技能集。同时,尝试将此经验作为通过dagger 2进行依赖注入(inject)的学习试验台。但是,使用maven-2 cmd构建包:

mvn assembly:assembly -DdescriptorId=jar-with-dependencies package'. 

生成具有完整依赖项的 zip jar 会产生以下异常跟踪:
[INFO] ------------------------------------------------------------------------
[INFO] Building Echo Device Client 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ echo-device-client ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/apil.tamang/Dropbox/Git/echo-device-client/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ echo-device-client ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 46 source files to /Users/apil.tamang/Dropbox/Git/echo-device-client/target/classes
An exception has occurred in the compiler (1.8.0_60). Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) after checking the database for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.IllegalStateException: endPosTable already set
        at com.sun.tools.javac.util.DiagnosticSource.setEndPosTable(DiagnosticSource.java:136)
        at com.sun.tools.javac.util.Log.setEndPosTable(Log.java:350)
        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:667)
        at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.<init>(JavacProcessingEnvironment.java:892)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.next(JavacProcessingEnvironment.java:921)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1187)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)

初始编译正常,所有测试都运行并成功执行。我觉得事情是在“链接”依赖关系的过程中发生的。请看this file在构建期间查看控制台输出。

我的问题是是否值得尝试使用不同的方式生成依赖项。为此,我对maven了解不多。有没有可以使用的补丁或其他东西?你认为甚至有可能想出一个解决方法吗?我希望能够继续使用 dagger 2 框架来构建这个项目。

最佳答案

错误报告 JDK-8067747 中描述了该问题。 :
(简·拉霍达)

To my knowledge, there are two aspects to this bug:

  1. the javac bug that it crashes with an exception. I am working on this, but please note that javac won't compile the input when this is fixed, it will throw an appropriate exception from the Filer (see below).

  2. what appears to be a maven bug: when the project is compiled with "clean install", an annotation processor will generate a source file into "target/generated-sources/annotations". When the incremental compilation is done, this generated file is passed to javac as an input, and the annotation processor will try to generate it again, which is not allowed.


这意味着当修复了 maven 错误时,javac用不适当的异常报告问题的错误变得无关紧要。但是,考虑到 Maven 2 的实际生命周期结束日期,我怀疑您能否期望找到修复或补丁。

关于compiler-errors - java.lang.IllegalStateException : endPosTable already set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36408706/

相关文章:

java - “找不到符号”或“无法解析符号”错误是什么意思?

Java编译行为

java - 将值传递给注入(inject)的 EJB

java-8 - JAVA 8 将谓词提取为字段或方法?

java - 推荐的 Maven 存储库搜索引擎?

java - 使用 Eclipse/Maven 构建 Hadoop - 缺少 Artifact jdk.tools :jdk. 工具 :jar:1. 6

python - 为什么下面的代码会产生缩进错误?

macos - 如何在 OSX Mavericks 上构建 OpenBLAS

java - Spark 类型不匹配 : cannot convert from JavaRDD<Object> to JavaRDD<String>

maven-2 - 如何从 Maven Reactor 构建中排除模块?