[2.0] not found: value routes

3,139 views
Skip to first unread message

Volker Janz

unread,
Apr 10, 2012, 3:33:17 AM4/10/12
to play-fr...@googlegroups.com
Hi,

I just started a project with Play 2.0 and now I´m stucked with an exception which I cannot comprehend, so maybe someone in this group can help - here is what I´ve done so far:

  • Created a new project with play new
  • Updated routes
  • Added dependencies for Quartz and MySQL
  • Created some empty controllers
  • Renamed the project by editing the Build.scala file
  • Created a base template which should serve as a base for other templates
  • Startet the server by play run
When I now load the page up in my browser, the console responds with following exception:

[error] application - 
! Internal server error, for request [GET /login] ->
sbt.PlayExceptions$CompilationException: Compilation error [not found: value routes]

This is the corresponding line in my template, that results in this exception:

<link rel="stylesheet" media="screen" href="@routes.Assets.at("bootstrap/css/bootstrap.css")">

This is my Build.scala:

import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
    val appName         = "TestManagement"
    val appVersion      = "1.0"
    val appDependencies = Seq(
    "org.quartz-scheduler" % "quartz" % "1.7.3",
    "mysql" % "mysql-connector-java" % "5.1.18"
    )
    val main = PlayProject(appName, appVersion, appDependencies).settings(      
    )
}
When I create a new Java project with example content, there is also a template with reverse routing for assets which works fine for me - I see no differences other than my dependencies so I do not understand the actual reason for my problem.

Any suggestions? :-)

Best regards
Volker 

pre

unread,
Apr 10, 2012, 3:43:17 AM4/10/12
to play-fr...@googlegroups.com
Even without my dependencies I get the error. I also tried to rename the application back to its initial name which also does not affect the error.

FYI: Here is my routes configuration:

GET /login controllers.User.login()
GET     /assets/*file                       controllers.Assets.at(path="/public", file)

Julien Richard-Foy

unread,
Apr 10, 2012, 4:04:31 AM4/10/12
to play-fr...@googlegroups.com
Append a mainLang parameter to your project definition:

val main = PlayProject(appName, appVersion, appDependencies, mainLang
= SCALA).settings(
)

pre

unread,
Apr 10, 2012, 4:06:19 AM4/10/12
to play-fr...@googlegroups.com
Works!! :-) Thank you!!

Vladimir Vlach

unread,
Jul 20, 2012, 12:20:52 PM7/20/12
to play-fr...@googlegroups.com
I have exactly same problem. mainLang = SCALA does not fix it. What can I do?

My CSS (trying to use LESS CSS):
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">



! Internal server error, for request [GET /assets/stylesheets/main.min.css] ->

sbt.PlayExceptions$CompilationException: Compilation error [not found: value routes]
        at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$
12$$anonfun$apply$13.apply(PlayReloader.scala:229) ~[na:na]
        at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$
12$$anonfun$apply$13.apply(PlayReloader.scala:229) ~[na:na]
        at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
        at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$
12.apply(PlayReloader.scala:229) ~[na:na]
        at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$
12.apply(PlayReloader.scala:226) ~[na:na]
        at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]


Thanks,
Vlad

Jochen

unread,
May 27, 2013, 3:42:37 PM5/27/13
to play-fr...@googlegroups.com
I have the same problem ("not found: value routes").  And when i try to add the mainLang setting i get a compile error: 
Im using Play 2.1.1

[error] Error occurred in an application involving default arguments.
[error]   val main = play.Project(appName, appVersion, appDependencies, mainLang
 = SCALA).settings(
[error]                                                                 ^
[error] one error found
[error] (compile:compile) Compilation failed

Thanks
Reply all
Reply to author
Forward
0 new messages