Skip to content
Jens Jäger

Play Framework 2.2 in IntelliJ, errors in controllers everywhere

This post is part of the archive. It was written years ago, so some of the tools, versions and links may be outdated.

Today I updated an application to Play Framework 2.2. After the creation of the IntelliJ config with “play idea”, I got errors in every reverse route and content call. Here are some examples how the errors locked like:

reverse\_routing\_error

content\_error

After fiddling around a bit I found out that the routes_routing.scala and the routes_reverseRouting.scala had errors to. Hmm this is weird. A look in the module setting (Click on the project folder -> Open Module Settings) provided me this:

module\_settings\_error

As you can see the folder target/scala-2.10/…/main is not a source folder. Only the underlying controllers and views folder. To fix the errors in the controllers just add “main” to the source folders and remove “controllers” and “views”.

Here is a screenshot how the fixed configurations should look like:

module\_settings\_fixed

Now the controllers should be fine. Happy coding!

8 comments

  1. THANK YOU!!! This has been driving me crazy

  2. ChrisDebug

    Yes! I too was having problems. Now, I have a new problem.

    After making the changes, “routes” is fixed but now “index()” is red. ugh!

  3. Alexey Zvolinskiy

    Respect
    You finished my pains

  4. Vinnie1991

    My hero!
    I hate that the IDE said “problems?”, but that it works.

    *Bows*

  5. JensAuthor

    Thank you all for your comments.

  6. Brian Z

    This is spot on! Can’t believe after all this time this is still an issue (1 year later). JetBrains get your stuff together! (Thanks Jens!)

  7. rafiozo

    THX! You helped me ;) Thank you.

  8. Adrian

    Looked around for a while and messed with settings and came across this. Thank you.

Comments are closed. Join the conversation on LinkedIn.