java.lang.IllegalStateException: endPosTable 已经设置 [英] java.lang.IllegalStateException: endPosTable already set

查看:38
本文介绍了java.lang.IllegalStateException: endPosTable 已经设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试建立 alexa (amazon:echo) 技能集.同时,尝试将本次体验作为dagger 2依赖注入的学习测试平台.然而,使用maven-2 cmd构建包:

Trying to build an alexa (amazon:echo) skills set. At the same time, trying to use this experience as a learning testbed for dependency injection through dagger 2. However, building the package using maven-2 cmd:

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

生成具有完整依赖项的 zip jar 会产生以下异常跟踪:

to generate a zip jar with the complete dependencies produces the following exception trace:

[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)

初始编译正常,所有测试都运行并成功执行.我觉得正是在链接"依赖关系的过程中,事情才向南发展.请查看这个文件以查看控制台输出构建.

The initial compilation happens fine, and all tests are run and successfully executed. I feel like it is during 'linking' the dependencies that things go south. Please take a look at this file to see the console output during the build.

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

My question is if it's worth a shot to try generate the dependencies using a different way. I don't know much about maven for that purpose. Is there a patch or something out there that can be used? Do you think it's even possible to come up with a workaround? I would like to be able to continue to use the dagger 2 framework for building this project.

推荐答案

错误报告中描述了该问题 JDK-8067747:

The issue is described in the bug report JDK-8067747:

(作者:Jan Lahoda)

据我所知,这个错误有两个方面:

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

  1. 它因异常而崩溃的 javac 错误.我正在解决这个问题,但请注意 javac 在修复此问题后不会编译输入,它会从 Filer 抛出适当的异常(见下文).

  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).

似乎是 maven 错误:当项目使用全新安装"编译时,注释处理器将生成一个源文件到目标/生成源/注释"中.增量编译完成后,这个生成的文件作为输入传递给javac,注解处理器会再次尝试生成,这是不允许的.

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 的 bug 被修复后,javac 报告错误异常的 bug 就变得无关紧要了.但是,考虑到 Maven 2 生命周期结束的实际日期,我怀疑您能否期望找到修复程序或补丁.

This implies that when the maven bug is fixed, javac’s bug of reporting the problem with an inappropriate exception becomes irrelevant. However, given the actual date of Maven 2’s end-of-life, I doubt that you can expect to find a fix or patch for it.

这篇关于java.lang.IllegalStateException: endPosTable 已经设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆