Java.lang.IllegalStateException: endPosTable already installed

Trying to create alexa skill set (amazon: echo). At the same time, trying to use this experience as a training stand for injecting addiction through dagger 2. However, building the package using maven-2 cmd:

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

to create a zip-jar with full dependencies creates 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, ie 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, ie 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 runs fine, and all tests run and succeed. I feel like things are going south during the β€œlinking” of dependencies. Please see this file to see console output during build.

My question is whether it is worth trying to generate dependencies using a different method. I know little for this purpose. Is there a patch or something out there that can be used? Do you find it possible to even come up with a workaround? I would like to be able to continue to use the scope of dagger 2 to create this project.

+7
java-8 maven-2 compiler-errors dagger-2
source share
4 answers

The problem is described in the error report JDK-8067747 :

(Jan Lauhoda)

As far as I know, there are two aspects to this error:

  • javac error with which it crashes with an exception. I am working on this, but note that javac will not compile the input, if this is fixed, it will throw a corresponding exception from Filer (see below).

  • what seems to be a maven error: when the project is compiled with a "clean install", the annotation handler will generate the source file in the "target / generated sources / annotations". When the incremental compilation is completed, this generated file is passed to javac as input, and the annotation processor will try to generate it again, which is not allowed.

This means that when the maven error is fixed, the t21 error with the error message with an inappropriate exception becomes irrelevant. However, given the actual Maven 2s end-of-life date, I doubt that you can expect to find a fix or patch for it.

+7
source share

I am not sure if this can help. For my case, I had the same problem with open-jdk 8u91 , I installed oracle-jdk, and I could run the project after mvn clean compile . The problem was that I had to switch between the JDK for each run and create it again using maven.

EDIT: after two days with him, I found that this is the result of a mismatch between maven and jdk . My IDE used maven 3.0.5 bundled with maven.

Decision. In your IDE, you must change your maven home directory from bundled maven to your current version, for example /usr/share/maven . (for me, the current version was 3.3.9)

0
source share

I encountered the same error with a project that was built and tested by Maven and JDK 1.8.0_121. In the initial configuration, the project was first cleaned up using mvn clean , then built using mvn install -projectSpecificParameters and finally tested using a separate mvn install -otherProjectSpecificParameters . This configuration led to the error mentioned in the question.

After changing the order of the stages (first testing and subsequent construction) and adding the clean target to the build command to clear the built-in state after the tests, the error was no longer reproduced.

0
source share

As explained in this issue , a workaround is to disable useIncrementalCompilation :

 <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <useIncrementalCompilation>false</useIncrementalCompilation> </configuration> </plugin> 
0
source share

All Articles