ItelliJ/IDEA 2016.1 and Wrong argument type ( scala vs. java )

204 views
Skip to first unread message

Þór Sigurðsson

unread,
Apr 20, 2016, 9:53:54 AM4/20/16
to play-framework
Hi all,

I have a problem which I'm having a hard time solving.

I have a fairly sizeable project in Play 2.3 and all of a sudden I'm getting "Wrong 2nd argument type. Found 'java.lang.String'. Required: 'string' - and this is happening "all over the place".

Example:

return redirect( controllers.routes.MyMenu.displayStep2( myRequestId, myRequest.aStringval() ) );

where the class function is defined as:

public static Result displayStep2( Long aRequestId, String aStringVal ) { ... }

and the routes definition is:

GET /some/step/:aStringVal/:aRequestId/2 controllers.MyMenu.displayStep2(aRequestId: Long, aStringVal: String )

I've made sure that the source directories are correctly marked and I've been unable to find anything that seems even remotely logical.

Flabbergasted - I am.

Is there anyone out there who has had the same or similar problem and found a solution?

With hope,
Thor


________________________________

Fyrirvari á tölvupósti / e-mail disclaimer
http://www.samgongustofa.is/fyrirvari/
'

Þór Sigurðsson

unread,
Apr 20, 2016, 10:35:06 AM4/20/16
to play-fr...@googlegroups.com
To clarify - I get this error in ItelliJ/IDEA - not when compiling using activator. Thus, the source is 100% ok but there's something in IDEA that isn't quite kosher. Question is - what?

Best,
Thor
>--
>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/0BF7C90C-A91F-4B63-9AAD-40EAB3268596%40samgongustofa.is.
>For more options, visit https://groups.google.com/d/optout.

Will Sargent

unread,
Apr 20, 2016, 2:03:47 PM4/20/16
to play-fr...@googlegroups.com
I've seen this happen sometimes when sbt is halfway through a compile and gets cancelled or the process gets killed -- the classes (or even the libraries being downloaded!) end up in an inconsistent state.

The best thing you can do is only compile through Activator or sbt, and not use IntelliJ IDEA to build / run Play projects.  

In addition, if you've cleaned out your project and you're still running into odd or impossible library issues, consider moving your $HOME/.ivy2 directory out and downloading everything from scratch.  

Will.

Þór Sigurðsson

unread,
Apr 20, 2016, 6:22:36 PM4/20/16
to play-fr...@googlegroups.com
I never use IntelliJ/IDEA to compile Play projects - I always use the command line. Additionally, Scala Compile Server is configured _not_ to run ( "Use external compile server for scala" ).

First I copied ( tar zcf .... ; scp ... ) the solution to a different computer and there, opened it in IntelliJ/IDEA (same version, byt the .ivy2 collection is at a different level since I used Play 2.5 on this computer only. Opening up the solution yielded the same results.

Next step: rename the .ivy2 directory and do "./activator update" - I had to do this three times since apparently resolving the libraries in the Maven repository is a bit flaky. Then reopen the solution. Nope. Now I have routing errors as well. And lots of them.

Next step: activator clean compile, still same as I started with ( the new routing errors were gone ).

Still: flabbergasted.


________________________________
Frá: play-fr...@googlegroups.com [play-fr...@googlegroups.com] fyrir hönd Will Sargent [will.s...@lightbend.com]
Sent: 20. apríl 2016 18:03
Til: play-fr...@googlegroups.com
Efni: Re: [play-framework] ItelliJ/IDEA 2016.1 and Wrong argument type ( scala vs. java )

I've seen this happen sometimes when sbt is halfway through a compile and gets cancelled or the process gets killed -- the classes (or even the libraries being downloaded!) end up in an inconsistent state.

The best thing you can do is only compile through Activator or sbt, and not use IntelliJ IDEA to build / run Play projects.

In addition, if you've cleaned out your project and you're still running into odd or impossible library issues, consider moving your $HOME/.ivy2 directory out and downloading everything from scratch.

Will.

On Wed, Apr 20, 2016 at 7:30 AM, Þór Sigurðsson <th...@samgongustofa.is<redir.aspx?REF=9-Va0G1f2KuXWnbXFn7b-1eKpRvxu5VrxaeL7h0v08CF5RB9Y2nTCAFtYWlsdG86dGhvcnNAc2FtZ29uZ3VzdG9mYS5pcw..>> wrote:
To clarify - I get this error in ItelliJ/IDEA - not when compiling using activator. Thus, the source is 100% ok but there's something in IDEA that isn't quite kosher. Question is - what?

Best,
Thor




On 20.4.2016, 13:53, "play-fr...@googlegroups.com<redir.aspx?REF=2A9f4bcnyIhp4GlePUSl0BNWNcWD88bJHyawG9MZ2aaF5RB9Y2nTCAFtYWlsdG86cGxheS1mcmFtZXdvcmtAZ29vZ2xlZ3JvdXBzLmNvbQ..> on behalf of Þór Sigurðsson" <play-fr...@googlegroups.com<redir.aspx?REF=2A9f4bcnyIhp4GlePUSl0BNWNcWD88bJHyawG9MZ2aaF5RB9Y2nTCAFtYWlsdG86cGxheS1mcmFtZXdvcmtAZ29vZ2xlZ3JvdXBzLmNvbQ..> on behalf of th...@samgongustofa.is<redir.aspx?REF=9-Va0G1f2KuXWnbXFn7b-1eKpRvxu5VrxaeL7h0v08CF5RB9Y2nTCAFtYWlsdG86dGhvcnNAc2FtZ29uZ3VzdG9mYS5pcw..>> wrote:

>Hi all,
>
>I have a problem which I'm having a hard time solving.
>
>I have a fairly sizeable project in Play 2.3 and all of a sudden I'm getting "Wrong 2nd argument type. Found 'java.lang.String'. Required: 'string' - and this is happening "all over the place".
>
>Example:
>
>return redirect( controllers.routes.MyMenu.displayStep2( myRequestId, myRequest.aStringval() ) );
>
>where the class function is defined as:
>
>public static Result displayStep2( Long aRequestId, String aStringVal ) { ... }
>
>and the routes definition is:
>
>GET /some/step/:aStringVal/:aRequestId/2 controllers.MyMenu.displayStep2(aRequestId: Long, aStringVal: String )
>
>I've made sure that the source directories are correctly marked and I've been unable to find anything that seems even remotely logical.
>
>Flabbergasted - I am.
>
>Is there anyone out there who has had the same or similar problem and found a solution?
>
>With hope,
>Thor
>
>
>________________________________
>
>Fyrirvari á tölvupósti / e-mail disclaimer
>http://www.samgongustofa.is/fyrirvari/<redir.aspx?REF=tWigACwZd7CiAcujywYgKUey5xqm2fIoTDcMyjktcHWF5RB9Y2nTCAFodHRwOi8vd3d3LnNhbWdvbmd1c3RvZmEuaXMvZnlyaXJ2YXJpLw..>
>'
>
>--
>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<redir.aspx?REF=XhiVmaa1pL9NtrOGXJtYPQK8xKPpog1SzQWwxxU7NP-F5RB9Y2nTCAFtYWlsdG86cGxheS1mcmFtZXdvcmslMkJ1bnN1YnNjcmliZUBnb29nbGVncm91cHMuY29t>.
>To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/0BF7C90C-A91F-4B63-9AAD-40EAB3268596%40samgongustofa.is<redir.aspx?REF=pP5NAf74grIiM5-dS3PPENDhKtHiFX1lRPYtbfwFd76F5RB9Y2nTCAFodHRwczovL2dyb3Vwcy5nb29nbGUuY29tL2QvbXNnaWQvcGxheS1mcmFtZXdvcmsvMEJGN0M5MEMtQTkxRi00QjYzLTlBQUQtNDBFQUIzMjY4NTk2JTQwc2FtZ29uZ3VzdG9mYS5pcw..>.
>For more options, visit https://groups.google.com/d/optout<redir.aspx?REF=qZDJrICIgUxv35zrx1QpDgUxfOnA4rwMlSj1PwxpeMCF5RB9Y2nTCAFodHRwczovL2dyb3Vwcy5nb29nbGUuY29tL2Qvb3B0b3V0>.

--
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<redir.aspx?REF=XhiVmaa1pL9NtrOGXJtYPQK8xKPpog1SzQWwxxU7NP-F5RB9Y2nTCAFtYWlsdG86cGxheS1mcmFtZXdvcmslMkJ1bnN1YnNjcmliZUBnb29nbGVncm91cHMuY29t>.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/97F18715-AB29-4385-8B17-EB0A596E9C4F%40samgongustofa.is<redir.aspx?REF=FIcSrY7X81xqs5Y7DgbVLUJ2T5DRS0v_xZJX2ZofqCyF5RB9Y2nTCAFodHRwczovL2dyb3Vwcy5nb29nbGUuY29tL2QvbXNnaWQvcGxheS1mcmFtZXdvcmsvOTdGMTg3MTUtQUIyOS00Mzg1LThCMTctRUIwQTU5NkU5QzRGJTQwc2FtZ29uZ3VzdG9mYS5pcw..>.
For more options, visit https://groups.google.com/d/optout<redir.aspx?REF=qZDJrICIgUxv35zrx1QpDgUxfOnA4rwMlSj1PwxpeMCF5RB9Y2nTCAFodHRwczovL2dyb3Vwcy5nb29nbGUuY29tL2Qvb3B0b3V0>.


--
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<redir.aspx?REF=otn93qaE3lPd5G_MZzn2wAN9ns42OBjMXcb5RQh9XMaF5RB9Y2nTCAFtYWlsdG86cGxheS1mcmFtZXdvcmsrdW5zdWJzY3JpYmVAZ29vZ2xlZ3JvdXBzLmNvbQ..>.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAJmgB638%2BMhcp5AzX1oXzKDKSNo4wMrk4d5v3BMJVVMEdW2Q_Q%40mail.gmail.com<redir.aspx?REF=ne03GMf7ceff6YA9lBwKXbYf8DvFZn7mS3DRl1kPMtSF5RB9Y2nTCAFodHRwczovL2dyb3Vwcy5nb29nbGUuY29tL2QvbXNnaWQvcGxheS1mcmFtZXdvcmsvQ0FKbWdCNjM4JTJCTWhjcDVBelgxb1h6S0RLU05vNHdNcms0ZDV2M0JNSlZWTUVkVzJRX1ElNDBtYWlsLmdtYWlsLmNvbT91dG1fbWVkaXVtPWVtYWlsJnV0bV9zb3VyY2U9Zm9vdGVy>.
For more options, visit https://groups.google.com/d/optout<redir.aspx?REF=qZDJrICIgUxv35zrx1QpDgUxfOnA4rwMlSj1PwxpeMCF5RB9Y2nTCAFodHRwczovL2dyb3Vwcy5nb29nbGUuY29tL2Qvb3B0b3V0>.

Þór Sigurðsson

unread,
Apr 22, 2016, 10:54:00 AM4/22/16
to play-fr...@googlegroups.com
Additional information: In the event log of IntelliJ, this is logged:




SBT project import


[warn] [FAILED ] tyrex#tyrex;1.0.1!tyrex.jar(src): (0ms) [warn] ====
local: tried [warn]
/Users/thors/.ivy2/local/tyrex/tyrex/1.0.1/srcs/tyrex-sources.jar
[warn] ==== activator-launcher-local: tried [warn]
file:/Users/thors/.activator/repository/tyrex/tyrex/1.0.1/srcs/tyrex-sources.jar
[warn] ==== activator-local: tried [warn]
file:/Developer/Java/activator-dist-1.3.6/repository/tyrex/tyrex/1.0.1/srcs/tyrex-sources.jar
[warn] ==== public: tried [warn]
http://repo1.maven.org/maven2/tyrex/tyrex/1.0.1/tyrex-1.0.1-sources.jar
[warn] ==== typesafe-releases: tried [warn]
http://repo.typesafe.com/typesafe/releases/tyrex/tyrex/1.0.1/tyrex-1.0.1-sources.jar
[warn] ==== typesafe-ivy-releasez: tried [warn]
http://repo.typesafe.com/typesafe/ivy-releases/tyrex/tyrex/1.0.1/srcs/tyrex-sources.jar
[warn] ==== Typesafe Releases Repository: tried [warn]
http://repo.typesafe.com/typesafe/releases/tyrex/tyrex/1.0.1/tyrex-1.0.1-sources.jar
[warn] [FAILED ] xalan#serializer;2.7.1!serializer.jar(src): (0ms)
[warn] ==== local: tried [warn]
/Users/thors/.ivy2/local/xalan/serializer/2.7.1/srcs/serializer-sources.jar
[warn] ==== activator-launcher-local: tried [warn]
file:/Users/thors/.activator/repository/xalan/serializer/2.7.1/srcs/serializer-sources.jar
[warn] ==== activator-local: tried [warn]
file:/Developer/Java/activator-dist-1.3.6/repository/xalan/serializer/2.7.1/srcs/serializer-sources.jar
[warn] ==== public: tried [warn]
http://repo1.maven.org/maven2/xalan/serializer/2.7.1/serializer-2.7.1-sources.jar
[warn] ==== typesafe-releases: tried [warn]
http://repo.typesafe.com/typesafe/releases/xalan/serializer/2.7.1/serializer-2.7.1-sources.jar
[warn] ==== typesafe-ivy-releasez: tried [warn]
http://repo.typesafe.com/typesafe/ivy-releases/xalan/serializer/2.7.1/srcs/serializer-sources.jar
[warn] ==== Typesafe Releases Repository: tried [warn]
http://repo.typesafe.com/typesafe/releases/xalan/serializer/2.7.1/serializer-2.7.1-sources.jar
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: FAILED
DOWNLOADS :: [warn] :: ^ see resolution messages for details ^ ::
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] ::
tyrex#tyrex;1.0.1!tyrex.jar(src) [warn] ::
xalan#serializer;2.7.1!serializer.jar(src) [warn]
::::::::::::::::::::::::::::::::::::::::::::::




These errors are ItelliJ/IDEA errors and I'm not sure why it's trying to re-download everything. Next step: re-create the SBT project (I'll keep y'all posted!)
>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/AD1870C410B3E342BF54E32A15D261A42B2E4A34%40usex01.sks.is.
>For more options, visit https://groups.google.com/d/optout.

Þór Sigurðsson

unread,
Apr 22, 2016, 12:13:30 PM4/22/16
to play-fr...@googlegroups.com
I recreated the IntelliJ/IDEA project from scratch ( create project from existing sources ) - and in the SBT settings I specifically unchecked EVERYTHING that might download or compile some scala-based stuff. Still to no avail!

I'm lost. Currently IntelliJ/IDEA is _NOT_ helpful, as even though a project compiles and runs - I'm not going to feel as safe as before since everything shows up with an error in the editor.

Pretty annoying.

Best and have a good week-end,
Thor
>To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ECA066B4-24C1-4620-84DD-3C5185189120%40samgongustofa.is.
Reply all
Reply to author
Forward
0 new messages