[2.4.0 java] eclipse reporting errors on Messages (and others) in scala template files after migration

121 views
Skip to first unread message

Fabian Gilson

unread,
Jul 3, 2015, 3:53:58 AM7/3/15
to play-fr...@googlegroups.com
Hi,

Since I migrated to 2.4, eclipse (with scala IDE and Play plugins) reports errors on any usage of Messages (but project compiles in activator).

I tried to recreate the project files from scratch (via activator ui, from sources only), but behavior is the same. I also installed the fork Play plugin as suggested in https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcweinreben%2Fscala-ide-play2&sa=D&sntz=1&usg=AFQjCNEiPtY4LGMBdDMiqD64pgpUlfsMKQ . It fixed part of the problem, but not the Messages (or flash) usages. Error is:

Multiple annotations found at this line:
   
- could not find implicit value for parameter messages: play.api.i18n.Messages
   
- not enough arguments for method apply: (implicit messages: play.api.i18n.Messages)String
     
in object Messages. Unspecified value parameter messages.

I can get rid of the errors in Eclipse by calling directly play.i18n.Messages.get("somekey"). It looks like a classpath problem in eclipse, but I could not find how to fix it.

Thanks for any advice,
Fabian

Fabian Gilson

unread,
Jul 10, 2015, 1:40:17 AM7/10/15
to play-fr...@googlegroups.com
 Sorry to bump this, but it looks like it is a build path problem. Any way to fix this ?

I tried to eclipsify (from activator and ui) a couple o times, also tried to reimport my fully-running 2.3.9 project from scratch, but nothing happened... Pretty annoying.

Any clue?

Evan Bennett

unread,
Jul 10, 2015, 2:11:45 AM7/10/15
to play-fr...@googlegroups.com
Have you tried:
* (in Eclipse) right-click on you project and select 'Properties'
* click on the 'Play2' option in the left menu
* you can change the 'Template default imports'

I have not tried this yet. I just noticed it was there.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/d5c4d94d-d2cb-483b-bb5e-16c3ab45d012%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
  Evan Bennett
  BInfTech(DataCommunications&SoftwareEng)(QUT) MACS

Fabian Gilson

unread,
Jul 10, 2015, 5:10:13 AM7/10/15
to play-fr...@googlegroups.com
The forked play-plugin resolved the top error message shown above. But all my other templates and generated sources (like the "routes"), are not recognized too. This is pretty annoying since before I upgraded from 2.3.9, everything was running smoothly.

I finally moved to intellij... and so far so good (after some struggling, but finally, java editors are at least not reporting dumb errors (after setting target/scala folder as generated source folder). But I still cannot have autocompletion in template files. Hope to solve this last issue...

Naftoli Gugenheim

unread,
Jul 12, 2015, 2:13:12 PM7/12/15
to play-fr...@googlegroups.com

Which edition of intellij?


Jay Q.

unread,
Jul 12, 2015, 3:05:51 PM7/12/15
to play-fr...@googlegroups.com

I had the same problem with 2.4 and did to do 2 things:

1. Run activator eclipse (from Activator UI or command line)
2. Go to Java Build Path > Libraries > Add External Class Folder and point it to the output folder: target/scala-<version>/classes

Fabian Gilson

unread,
Jul 13, 2015, 1:07:14 AM7/13/15
to play-fr...@googlegroups.com
Latest (14.1.4 community). Had to point to the make the scala-xx/classes_managed, routes and twirl as generated source folders. But still unable to have autocomplete in template files.
Also, I tried to import as said the the 2.4 doc (as an sbt project), but it did not work. I finally used the old idea-gen, imported as a scala project and tweaked the build path (as mentioned earlier).

Naftoli Gugenheim

unread,
Jul 13, 2015, 12:58:22 PM7/13/15
to play-fr...@googlegroups.com

Indeed, the community edition does not support play-specific features, like twirl templates and the routes file. For that you need Ultimate.


Reply all
Reply to author
Forward
0 new messages