Compilation error on Ninja demo project

40 views
Skip to first unread message

Arvis Bickovskis

unread,
May 31, 2013, 8:01:30 AM5/31/13
to ninja-f...@googlegroups.com

Good day!

Just discovered Ninja framework and decided to give a shot, but running demo project produces following compilation error:

ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/ApplicationController.java:[92,26] json() in ninja.Results cannot be applied to (java.util.List<ninja.validation.FieldViolation>)
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/ApplicationController.java:[94,26] json() in ninja.Results cannot be applied to (java.lang.String)
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/ApplicationController.java:[133,22] html() in ninja.Results cannot be applied to (java.util.Map<java.lang.String,java.lang.String>)
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/PersonController.java:[36,22] json() in ninja.Results cannot be applied to (models.Person)
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/PersonController.java:[42,22] json() in ninja.Results cannot be applied to (models.Person)
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/UdpPingController.java:[81,19] json() in ninja.Results cannot be applied to (int)
[ERROR] /Users/teste/prog/java/ninja/Firstproj/src/main/java/controllers/AsyncController.java:[42,45] json() in ninja.Results cannot be applied to (java.lang.String)
[INFO] 7 errors 


It is Mac 10.6.08 and Java version is:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-10M4406)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)

 
Any ideas what went wrong? 

Raphael André Bauer

unread,
May 31, 2013, 8:10:22 AM5/31/13
to ninja-f...@googlegroups.com
Can you post exactly what you are trying to run - and possibly maven
commands to set the demo project up? Btw - you should upgrade to Java
1.7 from Oracle anyways...


Cheers,

Raphael

viestards

unread,
May 31, 2013, 8:16:04 AM5/31/13
to ninja-f...@googlegroups.com
Thanks for response!

Just what what was told in Ninja introduction tutorial

mvn archetype:generate -DarchetypeGroupId=org.ninjaframework -DarchetypeArtifactId=ninja-core-demo-archetype
cd Firstproj/
mvn jetty:run
 
Arvis


--
You received this message because you are subscribed to a topic in the Google Groups "ninja-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ninja-framework/AOf19XAi4vY/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ninja-framewo...@googlegroups.com.
To post to this group, send email to ninja-f...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ninja-framework/CACRkZ6KfT41_y%3DZTUkeDw1MQXmVPPa%2B0XnVC644TqraXCny9bg%40mail.gmail.com?hl=en.



--
Arvis

Raphael André Bauer

unread,
May 31, 2013, 8:36:09 AM5/31/13
to ninja-f...@googlegroups.com
On Fri, May 31, 2013 at 2:16 PM, viestards <viestar...@gmail.com> wrote:
> Thanks for response!
>
> Just what what was told in Ninja introduction tutorial
>
>> mvn archetype:generate -DarchetypeGroupId=org.ninjaframework
>> -DarchetypeArtifactId=ninja-core-demo-archetype
>> cd Firstproj/
>> mvn jetty:run


Hi Arvis,


yes - there's a bug in the latest archetype.
You can fix that yourself. Basically all you have to do is to check
that the returns of method controllers always look like:
return Results.json().render(XY)
or return Results.html().render(xy).

wrong (and present in the archetype) is: Results.json(XY)

If you fix that it'll work fine. I'll push an update later this day...


Thanks for the report :)

Best,

Raphael

Raphael André Bauer

unread,
May 31, 2013, 10:36:23 AM5/31/13
to ninja-f...@googlegroups.com
We just pushed the fix (Version 1.4.3)

If you run

mvn archetype:generate -DarchetypeGroupId=org.ninjaframework
-DarchetypeArtifactId=ninja-core-demo-archetype
-DarchetypeVersion=1.4.3

it will work.


Thanks again for the report :)

Cheers,

Raphael
Reply all
Reply to author
Forward
0 new messages