1
votes

I'm trying to setup basic play scala application with Intellij IDE (v 10.5.1).

I followed the instructions http://www.jamesward.com/2011/07/28/setup-play-framework-with-scala-in-intellij

When I start the application from the IDE everything is OK: 01:44:20,734 INFO ~ Application 'hello6' is now started !

But when I try to open a page in browser I'm getting the error in the output:

application.index action not found

Action not found Action application.index could not be found. Error raised is Controller controllers.application not found

play.exceptions.ActionNotFoundException: Action application.index not found
    at play.mvc.ActionInvoker.getActionMethod(ActionInvoker.java:585)
    at play.mvc.ActionInvoker.resolve(ActionInvoker.java:84)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.Exception: Controller controllers.application not found

Looks like scala compilation just not happening for some reason. Everything works good if I'm running the application directly from play server.

Play v1.2.2, scala-module 0.9.1. Tried in Ubuntu 10.4 and Windows 7.

Updated adding routes file and Application.scala

# Home page
GET     /                                       Application.index

# Ignore favicon requests
GET     /favicon.ico                            404

# Map static resources from the /app/public folder to the /public path
GET     /public/                                staticDir:public

# Catch all
*       /{controller}/{action}                  {controller}.{action}

============================================================================

package controllers

import play._
import play.mvc._

object Application extends Controller {

    import views.Application._

    def index = {
        html.index("Your Scala application is ready!")
    }

}
4

4 Answers

3
votes

This part:

application.index

Seems wrong, shouldn't it be Application.index? With capital A. Check you routes file, maybe it has that typo.

3
votes

Found solution. In project structure PlayFramework Dependecies and Project Libraries were not configured properly. After I fixed paths to ...play/framework/lib and ...play/modules/scala-0.9.1/lib scala compilation start working.

0
votes

In the routes, put the action to be

controllers.Application.index
0
votes

I was having the same problem. After going to SBT projects and refresh it went away.

screen shot of SBT projects