jaxrs-analyzer: Error in test compilation after Jax-Analyzer

Hi guys,

I am getting an error in test compilation (maven) phase when I use JaxRS Analyzer. The error is:

[INFO] Compiling 2 source files to /home/PROCERGS.REDERS/rafael-pestano/projetos/cdi-crud/target/test-classes
An exception has occurred in the compiler (1.8.0_121). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.IllegalAccessError: tried to access method com.sun.tools.javac.parser.LazyDocCommentTable.<init>(Lcom/sun/tools/javac/parser/ParserFactory;)V from class com.sun.tools.javac.parser.JavacParser
	at com.sun.tools.javac.parser.JavacParser.newDocCommentTable(JavacParser.java:179)
	at com.sun.tools.javac.parser.JavacParser.<init>(JavacParser.java:166)
	at com.sun.tools.javac.parser.ParserFactory.newParser(ParserFactory.java:85)
	at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:627)
	at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:665)
	at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)

It looks like the byte code or javadoc analysis made test classes in an inconsistent state.

If I execute JaxRS analisys after test compilation then I got no error:

 <executions>
                    <execution>
                      <phase>package</phase> 
                        <goals>
                            <goal>analyze-jaxrs</goal>
                        </goals>
                        <configuration>
                            <backend>swagger</backend>
                            <resourcesDir>${project.build.finalName}/apidocs</resourcesDir>
                        </configuration>
                    </execution>
                </executions>

Also if I delete test classes I got no error 😉

Here is a simple maven project which reproduces the error, just do a clean package:

cdi-crud.zip

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

2a293a900ee2ab4cd0a533fcd7f68962d84735a7 added better JavaDoc parsing using the JavaParser (thanks @rmpestano for the hint!). This now removed the tools.jar and it’s unstable dependency-tinkering. Please test with the 0.17-SNAPSHOT version (Maven’s staging repositories needed for that). Will publish that afterwards.

I had the same compilation problem in a multi-module project. Switching to 0.17-SNAPSHOT solved it.