Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8186841

Javadoc error: com.sun.tools.javac.code.ClassFinder$BadClassFile

XMLWordPrintable

    • b118
    • x86_64
    • linux

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux opal 4.10.0-32-generic #36-Ubuntu SMP Tue Aug 8 12:10:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      Running the Javadoc tool produces an error that seems to be related to the javac compiler, although the code compiles fine.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Install JDK 9+181
      Install Maven 3.5.0

      $ git clone https://github.com/eclipse/jetty.project.git
      $ cd jetty.project
      $ git checkout 3c96cf200b201d26c416df86bafa835a09857a59
      $ mvn clean install -DskipTests
      $ mvn javadoc:javadoc


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Javadoc generation completes successfully.
      ACTUAL -
      Javadoc generation aborted with an error

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.0-M1:javadoc (default-cli) on project fcgi-server: An error has occurred in Javadoc report generation:
      [ERROR] Exit code: 1 - javadoc: error - An exception occurred while building a component: TagInfo
      [ERROR] (com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: /home/simon/.m2/repository/org/eclipse/jetty/jetty-proxy/9.4.7-SNAPSHOT/jetty-proxy-9.4.7-SNAPSHOT.jar(/org/eclipse/jetty/proxy/AsyncMiddleManServlet$1.class)
      [ERROR] class file contains malformed variable arity method: (org.eclipse.jetty.proxy.AsyncMiddleManServlet,java.nio.ByteBuffer[],javax.servlet.http.HttpServletRequest)
      [ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.)
      [ERROR] Please file a bug against the javadoc tool via the Java bug reporting page
      [ERROR] (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com)
      [ERROR] for duplicates. Include error messages and the following diagnostic in your report. Thank you.
      [ERROR] com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: /home/simon/.m2/repository/org/eclipse/jetty/jetty-proxy/9.4.7-SNAPSHOT/jetty-proxy-9.4.7-SNAPSHOT.jar(/org/eclipse/jetty/proxy/AsyncMiddleManServlet$1.class)
      [ERROR] class file contains malformed variable arity method: (org.eclipse.jetty.proxy.AsyncMiddleManServlet,java.nio.ByteBuffer[],javax.servlet.http.HttpServletRequest)
      [ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
      [ERROR] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:278)
      [ERROR] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readMethod(ClassReader.java:2402)
      [ERROR] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2641)
      [ERROR] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2706)
      [ERROR] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2719)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:348)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:285)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1314)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:1248)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:800)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems0(Utils.java:2468)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems0(Utils.java:2463)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.recursiveGetItems(Utils.java:2451)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils$16.visitPackage(Utils.java:2436)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils$16.visitPackage(Utils.java:2432)
      [ERROR] at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.accept(Symbol.java:1166)
      [ERROR] at java.compiler@9/javax.lang.model.util.AbstractElementVisitor6.visit(AbstractElementVisitor6.java:106)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getItems(Utils.java:2445)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getClasses(Utils.java:2182)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.getAllClasses(Utils.java:2355)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.findClassInPackageElement(Utils.java:1047)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.WorkArounds.searchClass(WorkArounds.java:231)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.Utils.findClass(Utils.java:1065)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ThrowsTaglet.inherit(ThrowsTaglet.java:76)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.DocFinder.search(DocFinder.java:257)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util.DocFinder.search(DocFinder.java:270)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ThrowsTaglet.inheritThrowsDocumentation(ThrowsTaglet.java:133)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.ThrowsTaglet.getTagletOutput(ThrowsTaglet.java:164)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.TagletWriter.genTagOutput(TagletWriter.java:238)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.addTagsInfo(HtmlDocletWriter.java:319)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.MethodWriterImpl.addTags(MethodWriterImpl.java:206)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildTagInfo(MethodBuilder.java:207)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:157)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:87)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.buildChildren(AbstractBuilder.java:200)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.MethodBuilder.buildMethodDoc(MethodBuilder.java:151)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:157)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:87)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.buildChildren(AbstractBuilder.java:200)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildMethodDetails(ClassBuilder.java:412)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:157)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.buildChildren(AbstractBuilder.java:200)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildMemberDetails(ClassBuilder.java:346)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:157)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.buildChildren(AbstractBuilder.java:200)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:155)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:157)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.builders.ClassBuilder.build(ClassBuilder.java:125)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:263)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:273)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:207)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:117)
      [ERROR] at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:574)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:423)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:340)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
      [ERROR] at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
      [ERROR]
      [ERROR] Command line was: /home/simon/programs/jdk9/bin/javadoc @options @packages


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Make the anonymous inner class a named inner class, see https://github.com/eclipse/jetty.project/issues/1741.

            ksrini Kumar Srinivasan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: