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

NullPointerException in JavaCompiler.readSourceFile

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux

      Description

      ADDITIONAL SYSTEM INFORMATION :
      $ java -version
      openjdk version "11.0.1" 2018-10-16
      OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
      OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

      $ uname -a
      Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      When building the project certain projects with Maven and Java 11, I get a NullPointerException within the Java compiler.
      Same projects builds with JDK 8 without problems.

      Stacktrace is

          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:566)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
          at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1140)
          at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:188)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:566)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
      Caused by: org.codehaus.plexus.compiler.CompilerException
          at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:173)
          at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
          at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1129)
          at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:188)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:566)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
      Caused by: java.lang.NullPointerException
          at com.sun.tools.javac.main.JavaCompiler.readSourceFile (JavaCompiler.java:841)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment$ImplicitCompleter.complete (JavacProcessingEnvironment.java:1521)
          at com.sun.tools.javac.code.Symbol.complete (Symbol.java:642)
          at com.sun.tools.javac.code.Symbol$ClassSymbol.complete (Symbol.java:1326)
          at com.sun.tools.javac.code.Type$ClassType.complete (Type.java:1140)
          at com.sun.tools.javac.code.Type$ClassType.getTypeArguments (Type.java:1066)
          at com.sun.tools.javac.code.Printer.visitClassType (Printer.java:237)
          at com.sun.tools.javac.code.Printer.visitClassType (Printer.java:52)
          at com.sun.tools.javac.code.Type$ClassType.accept (Type.java:993)
          at com.sun.tools.javac.code.Printer.visit (Printer.java:136)
          at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument (AbstractDiagnosticFormatter.java:199)
          at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments (AbstractDiagnosticFormatter.java:167)
          at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:111)
          at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:67)
          at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument (AbstractDiagnosticFormatter.java:185)
          at com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments (AbstractDiagnosticFormatter.java:167)
          at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:111)
          at com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage (BasicDiagnosticFormatter.java:67)
          at com.sun.tools.javac.util.JCDiagnostic.getMessage (JCDiagnostic.java:788)
          at com.sun.tools.javac.api.ClientCodeWrapper$DiagnosticSourceUnwrapper.getMessage (ClientCodeWrapper.java:799)
          at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:131)
          at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
          at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1129)
          at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:188)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:566)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)


      REGRESSION : Last worked in version 11.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Not known where the problem comes from. Affects certain projects and certain projects build ok..
      The stacktrace will probably point to the problem.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No NPE

      CUSTOMER SUBMITTED WORKAROUND :
      Use JDK 8

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: