Unable to resolve function if it has arguments using FunctionNameCoventionRoutes

11 views
Skip to first unread message

MD

unread,
Jul 13, 2012, 8:48:48 PM7/13/12
to Bowler Users
Here's my function definition:
def `GET /api/register/:id`( id: String ) = {
....
}

Caused by: java.lang.IllegalStateException: cannot resolve a function
that matches the definition Member(Def,GET /api/
register/:id,GenericTypeDefinition(scala.Unit,None),List())
at org.bowlerframework.controller.POSORouteMapper
$.createClosure(POSORouteMapper.scala:137)
at org.bowlerframework.controller.POSORouteMapper
$.registerMember(POSORouteMapper.scala:35)
at org.bowlerframework.controller.POSORouteMapper$$anonfun$apply
$1.apply(POSORouteMapper.scala:27)
at org.bowlerframework.controller.POSORouteMapper$$anonfun$apply
$1.apply(POSORouteMapper.scala:22)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:76)
at org.bowlerframework.controller.POSORouteMapper
$.apply(POSORouteMapper.scala:22)
at org.bowlerframework.controller.FunctionNameConventionRoutes$class.
$init$(FunctionNameConventionRoutes.scala:14)
at com.corp.controllers.RegistrationController
$.<init>(RegistrationController.scala:15)
at com.corp.controllers.RegistrationController
$.<clinit>(RegistrationController.scala)


If I drop the id argument, I don't see the exception. But then, there
is no point in going with the FunctionNameConventionRoute.

Any help would be appreciated. Using bowlerframework 0.6 and scalatra
2.0.4

Thanks,

MD

Mrityunjay Kant

unread,
Jul 14, 2012, 10:25:33 AM7/14/12
to bowler...@googlegroups.com
How are you calling the said api? It should be of form: http://server:port/api/register/xyz

There should be no trialing / at the end of url or it won't match.

~Mrityunjay

MD

unread,
Jul 16, 2012, 12:01:32 AM7/16/12
to bowler...@googlegroups.com
I don't believe it has anything to do with my URL. I am not even calling it. It happens at start-up during initialization of the controllers.

-MD

Mrityunjay Kant

unread,
Jul 18, 2012, 2:58:10 AM7/18/12
to bowler...@googlegroups.com
I'm pretty sure there is nothing wrong with your code. What version of Bowler are you using? It should be 0.5.1?

Robin Green

unread,
Oct 6, 2012, 5:47:27 AM10/6/12
to bowler...@googlegroups.com
It's possible that you were seeing https://github.com/bowler-framework/Bowler/issues/26

Was your controller an inner class?
Reply all
Reply to author
Forward
0 new messages