September 24, 2013

Play Framework 2.2 in IntelliJ, errors in controllers everywhere

8  comments

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!


Tags

IntelliJ, Java, Play Framework, Play Framework 2.2, Scala


You may also like

Leave a Reply

Your email address will not be published. Required fields are marked

Information about Data protection

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. 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!

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

    *Bows*

  3. 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!)

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}