简体   繁体   中英

Intellij doesn't compile Play 2.4 apps: Module 'root' production: java.lang.NullPointerException

I was using IntelliJ 15.0.2 Ultimate to develop Play 2.4.6 apps. Everything was fine until the last Friday that IntelliJ was broken and I don't know why. Really, I don't know if it was something that I upgraded or something that I changed.

This is what I get after click on make :

在此输入图像描述

I have this on ~/.IntelliJIdea15/system/log/build-log/build.log :

2016-01-20 16:25:17,025 [  27009]   INFO - .incremental.IncProjectBuilder - Module 'root' production: java.lang.NullPointerException
org.jetbrains.jps.incremental.ProjectBuildException: Module 'root' production: java.lang.NullPointerException
        at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1005)
        at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:870)
        at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:695)
        at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:386)
        at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:193)
        at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:137)
        at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:294)
        at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
        at //[...]

I'm getting this error message when I try to make/build/rebuld/test the app. I tried EVERYTHING:

  • Upgraded Kubuntu 15.10 with the last patches
  • Created a new and clean Play app and imported to IntelliJ
  • Called $ activator clean and $ activator run on a terminal
  • Cleared Ivy cache
  • Cleared IntelliJ cache
  • Deleted .idea and target directories and imported the project again
  • Removed Java 1.7 and 1.8 and installed again only 1.8
  • Removed IntellJ 15.0.2 and ~/.IntelliJIdea15 directory
  • Installed IntelliJ 15.0.3 Ultimate as root once and as a regular user on another
  • Opened build.properties and changed sbt.version to 0.13.7, 0.13.8, 0.13.9
  • Opened build.sbt and changed scalaVersion to 2.11.7 and 2.11.6
  • Installed sbt

Anyway, $ activator run and $ activator test work fine. If I open the project on IntelliJ and use [Right click] > Run Play 2 App , it works too. But if I try to make, rebuild, debug or run tests on IntelliJ, I get that error .

I will appreciate your help.

Update: This project COMPILES WITHOUT PROBLEMS into the same environment ==> https://github.com/pac4j/play-pac4j-java-demo

Just in case, this was the workaround I used to fix that problem, as I documented on https://youtrack.jetbrains.com/issue/SCL-9780

  • On IDEA, click on File > Settings > Languages & Frameworks > Play2, and disable "Use Play 2 compiler for this project"
  • Open a terminal, go to the project's directory and run $ activator clean compile test

Anyway, if you have Ultimate 2016.1 or later, you should be okay.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM