开发者

Play framework scala Intellij IDE action not found

开发者 https://www.devze.com 2023-04-02 03:55 出处:网络
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

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!")
    }

}


This part:

application.index

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


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.


In the routes, put the action to be

controllers.Application.index


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

Play framework scala Intellij IDE action not found

0

精彩评论

暂无评论...
验证码 换一张
取 消