Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playframework 2.3.0 issue with Scala IDE (Kepler)

Environment: Java 8, Scala 10, play 2.3.0 sbt plugin, scala ide kepler Version: 4.3.0


Issue: 1. Generated classes for "index.scala.html" and my own created new templates is populating properly into "/my-first-app/target/scala-2.10/classes_managed/views/html" folder but while writing code into application controller I am not able to see these class when I tried to import classes individually instead of import views.html.* but I am not able to do that its not showing generated class I don't know why?

What I have tried:

  1. windows->preference->workspace-> checked the check box "refresh using native hooks or polling" -> clicked apply
  2. after every "~run" I used to refresh my workspace always.
  3. I added output folders manually for
    • /my-first-app/target/scala-2.10/classes_managed/
    • /my-first-app/target/scala-2.10/classes

After trying all still I am not able to import classes individually for any of xyz.scala.html file.


Issue 2: Getting multiple weird errors in xyz.scala.html syntax error for e.g.

Code snippet:

@(title: String)(content: Html) --> Error 
<!DOCTYPE html>
<html>
    <head>
        <title>@title</title>
        <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
        <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
        <script src="@routes.Assets.at("javascripts/hello.js")" type="text/javascript"/> 
        </script>
    </head>
    <body>
        @content
    </body>
</html>
  • Error:

    Multiple annotations found at this line:
             *too many arguments for constructor Object: ()Object
             *object templates is not a member of package play
             *type Template2 is not a member of package play.api.templates
             *not found: type BaseScalaTemplate
    

It is really annoying while development its slow downs the development speed.

like image 306
Ankur Bhargava Avatar asked Jun 26 '14 11:06

Ankur Bhargava


Video Answer


1 Answers

Try again! Scala ide just got an update and at least the nightly version supports play 2.3.

The update site for eclipse kepler is
http://download.scala-ide.org/sdk/lithium/e38/scala211/dev/site/

In eclipse go to project>properties>play2 and remove all the play.api.templates imports, those don't exist anymore.


ps: on a side note: i've started a google doc with notes on play+eclipse, feel free to add your own findings. Play 2.3 and Eclipse

like image 80
kritzikratzi Avatar answered Oct 19 '22 03:10

kritzikratzi