Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
No QueryString binder found for type Option[java.util.UUID]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Drew Kutcharian  
View profile  
 More options Apr 30 2012, 9:55 pm
From: Drew Kutcharian <d...@venarc.com>
Date: Mon, 30 Apr 2012 18:55:17 -0700
Local: Mon, Apr 30 2012 9:55 pm
Subject: No QueryString binder found for type Option[java.util.UUID]
Hi All,

I'm getting "No QueryString binder found for type Option[java.util.UUID]" even though I have an implicit QueryStringBinder for UUID in scope. Do I need to create a separate binder for Option[UUID]? How does Play's bindableOption work then?

Here's the compiler output

[error] /Users/drew/Projects/Shopper/workspace/Shopper/target/scala-2.9.1/src_manag ed/main/routes_reverseRouting.scala:231: No QueryString binder found for type Option[java.util.UUID]. Try to implement an implicit QueryStringBindable for this type.
[error]    Call("GET", Routes.prefix + { if(Routes.prefix.endsWith("/")) "" else "/" } + "api/circles/" + implicitly[PathBindable[UUID]].unbind("cid", cid) + "/connections" + queryString(List(if(from == None) None else Some(implicitly[QueryStringBindable[Option[UUID]]].unbind("from", from)), if(limit == None) None else Some(implicitly[QueryStringBindable[Option[Int]]].unbind("limit", limit)))))
[error]                                                                                                                                                                                                                                             ^
[error] /Users/drew/Projects/Shopper/workspace/Shopper/target/scala-2.9.1/src_manag ed/main/routes_reverseRouting.scala:893: No JavaScript litteral binder found for type Option[java.util.UUID]. Try to implement an implicit JavascriptLitteral for this type.
[error]       return _wA({method:"GET", url:"""" + Routes.prefix + { if(Routes.prefix.endsWith("/")) "" else "/" } + """" + "api/circles/" + (""" + implicitly[PathBindable[UUID]].javascriptUnbind + """)("cid", cid) + "/connections" + _qS([(from == """ +  implicitly[JavascriptLitteral[Option[UUID]]].to(None) + """ ? null : (""" + implicitly[QueryStringBindable[Option[UUID]]].javascriptUnbind + """)("from", from)), (limit == """ +  implicitly[JavascriptLitteral[Option[Int]]].to(None) + """ ? null : (""" + implicitly[QueryStringBindable[Option[Int]]].javascriptUnbind + """)("limit", limit))])})
[error]                                                                                                                                                                                                                                                                            ^
[error] /Users/drew/Projects/Shopper/workspace/Shopper/target/scala-2.9.1/src_manag ed/main/routes_routing.scala:537: No QueryString binder found for type Option[java.util.UUID]. Try to implement an implicit QueryStringBindable for this type.
[error]    call(params.fromPath[UUID]("cid", None), params.fromQuery[Option[UUID]]("from", Some(None)), params.fromQuery[Option[Int]]("limit", Some(None))) { (cid, from, limit) =>
[error]                                                                                ^

Thanks,

Drew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julien Richard-Foy  
View profile  
 More options May 1 2012, 3:52 am
From: Julien Richard-Foy <j...@zenexity.com>
Date: Tue, 1 May 2012 09:52:14 +0200
Local: Tues, May 1 2012 3:52 am
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]
Hi,
It should work. How are you sure there is an implicit
QueryStringBindable[UUID] available in your scope?
Regards.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Kutcharian  
View profile  
 More options May 1 2012, 4:00 am
From: Drew Kutcharian <d...@venarc.com>
Date: Tue, 1 May 2012 01:00:49 -0700
Local: Tues, May 1 2012 4:00 am
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]
Hi Julien,

I'm importing a QueryStringBindable[UUID] using routesImport in Build.scala. I also looked at the generated Routes Scala class and my imports were imported at the top. I even tried making a QueryStringBindable[Option[UUID]] and that didn't work also. I pretty much followed your blog post regarding PathBindables. Are QueryStringBindables any different?

- Drew

On May 1, 2012, at 12:52 AM, Julien Richard-Foy <j...@zenexity.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julien Richard-Foy  
View profile  
 More options May 1 2012, 4:14 am
From: Julien Richard-Foy <j...@zenexity.com>
Date: Tue, 1 May 2012 10:14:59 +0200
Local: Tues, May 1 2012 4:14 am
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]
It should work, can you paste the code showing how is the
QueryStringBindable defined (including its package declaration) and
how is the route defined?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dres  
View profile  
 More options Nov 13 2012, 12:02 pm
From: dres <andres.ma...@gmail.com>
Date: Tue, 13 Nov 2012 09:02:00 -0800 (PST)
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

I have the same issue with a scala binder in a java project.  Is that
possible?

Build.scala:
<code>
val main = PlayProject(appName, appVersion, appDependencies, mainLang =
JAVA).settings(

// Add your own project settings here

routesImport += "binders._"

)
</code>

binders/CustomBinders.scala:
<code>

package binders;

import org.joda.time.DateTime

import java.util.Date

import java.text.SimpleDateFormat

import play.api.mvc.QueryStringBindable

import java.net.URLEncoder

import org.joda.time.format.DateTimeFormat

import org.joda.time.DateTimeZone

object CustomBinders {

  implicit def dateTimeQueryBinder = new QueryStringBindable[DateTime] {

  def bind(key: String, params: Map[String, Seq[String]]) =

    params.get(key).flatMap(_.headOption).map { s =>

     try {

       val formatter = new SimpleDateFormat(

   "EEE, d MMM yyyy HH:mm:ss z");

  val someDate = formatter.parse(s);

       Right(new DateTime(someDate.getTime(),DateTimeZone.UTC))

     } catch {

       case e: NumberFormatException => Left("Cannot parse parameter " +
key + " as Int: " + e.getMessage)

     }

   }

  def unbind(key: String, value: DateTime) = {

    val fmt = DateTimeFormat

  .forPattern("EEE, d MMM yyyy HH:mm:ss z");

    key + "=" + (URLEncoder.encode(fmt.print(value), "utf-8"))

  }

  }

}

</code>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dres  
View profile  
 More options Nov 13 2012, 12:05 pm
From: dres <andres.ma...@gmail.com>
Date: Tue, 13 Nov 2012 09:05:21 -0800 (PST)
Local: Tues, Nov 13 2012 12:05 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

Sorry, it's
routesImport += "binders.CustomBinders._"

I know the scala is being compiled because if I can file compilation of my
implicit binder def with a typo.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Roper  
View profile  
 More options Nov 14 2012, 7:33 pm
From: James Roper <jrop...@gmail.com>
Date: Wed, 14 Nov 2012 16:33:04 -0800 (PST)
Local: Wed, Nov 14 2012 7:33 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

I think it actually should be:

routesImport ++= "binders.CustomBinders._"

If that doesn't work, then in target/scala-2.9.1/src_managed/main you
should find the two compile routes files, routes_reverseRouting.scala and
routes_routing.scala.

Can you check that your routes import is somewhere at the top of those
files?  If it is, then could you paste the logs of the compile error?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dres  
View profile  
 More options Nov 15 2012, 4:44 pm
From: dres <andres.ma...@gmail.com>
Date: Thu, 15 Nov 2012 13:44:21 -0800 (PST)
Local: Thurs, Nov 15 2012 4:44 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

Still a failure:

[info] Compiling 3 Scala sources and 2 Java sources to
/Users/andres/source/plaor-git/hwp-bi/target/scala-2.9.1/classes...
[error]
/Users/andres/source/plaor-git/hwp-bi/target/scala-2.9.1/src_managed/main/r outes_reverseRouting.scala:68:
No QueryString binder found for type org.joda.time.DateTime. Try to
implement an implicit QueryStringBindable for this type.
[error]    Call("GET", "/tables/clicks" +
queryString(List(Some(implicitly[QueryStringBindable[org.joda.time.DateTime ]].unbind("startDateTime",
startDateTime)))))
[error]                                                                   ^
[error]
/Users/andres/source/plaor-git/hwp-bi/target/scala-2.9.1/src_managed/main/r outes_reverseRouting.scala:220:
No QueryString binder found for type org.joda.time.DateTime. Try to
implement an implicit QueryStringBindable for this type.
[error]       return _wA({method:"GET", url:"/tables/clicks" + _qS([(""" +
implicitly[QueryStringBindable[org.joda.time.DateTime]].javascriptUnbind +
""")("startDateTime", startDateTime)])})
[error]                                                                    
         ^
[error]
/Users/andres/source/plaor-git/hwp-bi/target/scala-2.9.1/src_managed/main/r outes_routing.scala:96:
No QueryString binder found for type org.joda.time.DateTime. Try to
implement an implicit QueryStringBindable for this type.
[error]    call(params.fromQuery[org.joda.time.DateTime]("startDateTime",
None)) { (startDateTime) =>
[error]                                                 ^
[error] three errors found
[error]
{file:/Users/andres/source/plaor-git/hwp-bi/}hwp-bi/compile:compile:
Compilation failed
[error] application -

! Internal server error, for request [GET /] ->

sbt.PlayExceptions$CompilationException: Compilation error [No QueryString
binder found for type org.joda.time.DateTime. Try to implement an implicit
QueryStringBindable for this type.]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$an onfun$apply$13.apply(PlayReloader.scala:236)
~[na:na]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$an onfun$apply$13.apply(PlayReloader.scala:236)
~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.app ly(PlayReloader.scala:236)
~[na:na]
at
sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.app ly(PlayReloader.scala:233)
~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]

It looks like the import isn't including the object in the import path:

import play.core._
import play.core.Router._
import play.core.j._

import play.api.mvc._
import play.libs.F
--> import binders._

import Router.queryString

object Routes extends Router.Routes {


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dres  
View profile  
 More options Nov 16 2012, 11:19 am
From: dres <andres.ma...@gmail.com>
Date: Fri, 16 Nov 2012 08:19:00 -0800 (PST)
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

I figured it out, I think.  The routes don't seem to get regenerated unless
I run play clean.  I had the wrong route like you pointed out but I had
tried importing the object before and it didn't work.  Thanks for pointing
me to the generated scala code. It wasn't getting updated just by exiting
the console and restarting play run.  Is this a bug or expected behavior?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Roper  
View profile  
 More options Nov 16 2012, 8:59 pm
From: James Roper <jrop...@gmail.com>
Date: Fri, 16 Nov 2012 17:59:46 -0800 (PST)
Local: Fri, Nov 16 2012 8:59 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

This is expected behaviour... the routes classes are regenerated if the
routes file changes.  Changing any configuration in Build.scala will
usually require a clean to ensure that it takes effect.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres March  
View profile  
 More options Nov 17 2012, 6:38 pm
From: Andres March <andres.ma...@gmail.com>
Date: Sat, 17 Nov 2012 17:38:10 -0600
Local: Sat, Nov 17 2012 6:38 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

Any chance you would take a enhancement request to change that behavior? It
seems contrary to most development cycles to have to clean when the project
build file is changed IMHO.  I'd at least like to contribute to the
documentation to clarify the lifecycle.  I may have just missed but I
haven't seen much on the topic.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Roper  
View profile  
 More options Nov 18 2012, 11:27 pm
From: James Roper <jrop...@gmail.com>
Date: Sun, 18 Nov 2012 20:27:26 -0800 (PST)
Local: Sun, Nov 18 2012 11:27 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

I don't think it is contrary... and I don't know any other build tools that
work any different.  For example, if you were using Maven, and you changed
the target JVM version in the configuration, and then did a normal build,
it wouldn't recompile anything.  If you remove a dependency in SBT or
maven, and then build, again, it won't recompile anything, it's not until
you do a clean build that it breaks.  The reason why things behave this way
is that there's no way for the build tool to know which changes to your
build configuration should require a clean build, only you can know this,
so the build tool has two options, always do a clean build when the build
configuration changes, or trust you to know what you're doing.  Personally,
I'd rather the build tool trust me and only do a (much slower) clean build
when I tell it to.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres March  
View profile  
 More options Nov 18 2012, 11:45 pm
From: Andres March <andres.ma...@gmail.com>
Date: Sun, 18 Nov 2012 22:45:21 -0600
Local: Sun, Nov 18 2012 11:45 pm
Subject: Re: [play-framework] No QueryString binder found for type Option[java.util.UUID]

I agree with your point about the build tool trusting the user and we can
leave it at that.  But I think source code generation is a whole different
ball game than changing dependencies or runtime.  In both your examples if
the source code had changed as it must for the routes, the code would be
recompiled.  Just my perspective.  Thanks again for your help.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »