craastad
craastad

Reputation: 6482

Play framework 2 running unit tests in Intellij IDEA 13

There are two very similar questions here and here. I created a project with play new and ran play idea. The tests run with the play test command and when I try to run them in IDEA I get the following stacktrace.

Internal error: (java.lang.ClassNotFoundException) com.pty4j.PtyProcess
java.lang.ClassNotFoundException: com.pty4j.PtyProcess
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.intellij.scala.play.jpsSupport.Play2TemplateJpsBuilder$$anonfun$build$1.apply(Play2TemplateJpsBuilder.scala:90)
    at com.intellij.scala.play.jpsSupport.Play2TemplateJpsBuilder$$anonfun$build$1.apply(Play2TemplateJpsBuilder.scala:88)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:105)
    at com.intellij.scala.play.jpsSupport.Play2TemplateJpsBuilder.build(Play2TemplateJpsBuilder.scala:88)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1086)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:797)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:845)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:760)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:583)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:344)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:184)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:129)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:224)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:133)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

I have tried turning off the external compiler server in Settings (IDE) -> Scala, invalidating cache, and get the same exception. This is jetbrains post about the compiler server.

Upvotes: 3

Views: 1459

Answers (2)

Justin
Justin

Reputation: 70

In my case, the problem has not solved with 133.331. IntelliJ 13 still does not compile test codes.

I think it's due to external build, because there is no problem with IntelliJ 12 of which external build option is off.

Upvotes: 2

Yeonho
Yeonho

Reputation: 3623

Updating IntelliJ from 13.0.1 133.330 to 13.0.1 133.331 fixed this issue for me.

Upvotes: 0

Related Questions