ReactiveMongo updated to Scala 2.10

711 views
Skip to first unread message

Stephane Godbillon

unread,
Nov 14, 2012, 3:27:04 PM11/14/12
to reacti...@googlegroups.com
Hey,

I just pushed a Scala 2.10 compatible version of ReactiveMongo into the master branch.

From now on, ReactiveMongo does not depend on the whole Play project anymore, but rather on the sole Iteratee library (thanks to the Play team). The akka dependency has been upgraded to 2.1 as well.

The maven repository contains the artifacts for 2.10. For people using ReactiveMongo along with Play, I have also update one of the examples: https://github.com/sgodbillon/reactivemongo-demo-app. I will update the rest soon :)

As usual, don't hesitate to report any bug or question.

Cheers!

James Cain

unread,
Nov 14, 2012, 3:33:03 PM11/14/12
to reacti...@googlegroups.com
Awesome!!!

Scott Abernethy

unread,
Nov 14, 2012, 4:55:27 PM11/14/12
to reacti...@googlegroups.com
Fantastic, I've been waiting for that.

Is the Play2.1 snapshot linked on https://github.com/sgodbillon/reactivemongo-demo-app updated also? If not, I guess we should use one of the latest Play2.1 weekly snapshots?

Thx!

Alex Jarvis

unread,
Nov 15, 2012, 4:59:30 AM11/15/12
to reacti...@googlegroups.com
Does this mean we should build against 2.1-master now instead of the previous snapshot?

Stephane Godbillon

unread,
Nov 15, 2012, 8:17:52 AM11/15/12
to reacti...@googlegroups.com
Yes :)
2012/11/15 Alex Jarvis <alex.j...@gmail.com>
--
 
 

Alex Jarvis

unread,
Nov 15, 2012, 9:23:24 AM11/15/12
to reacti...@googlegroups.com
Any pointers? Last time I tried this it went horribly wrong ;)

I'm guessing I can just copy the changes like you made to the sample project?

--
 
 

Stephane Godbillon

unread,
Nov 15, 2012, 10:45:27 AM11/15/12
to reacti...@googlegroups.com
Yes, you can see the changes I made to the Articles example : https://github.com/sgodbillon/reactivemongo-demo-app .
2012/11/15 Alex Jarvis <alex.j...@gmail.com>
--
 
 

Alex Jarvis

unread,
Nov 15, 2012, 10:47:34 AM11/15/12
to reacti...@googlegroups.com
Thanks, any idea why I get a million of these lines?

*** DEBUGGING PROMISE[scala.concurrent.impl.Promise$DefaultPromise@165f350] :: ok=true

--
 
 

Stephane Godbillon

unread,
Nov 15, 2012, 11:23:57 AM11/15/12
to reacti...@googlegroups.com
Yes, sorry I forgot to remove some extra debug lines.

It will be fixed in the next commit :)
2012/11/15 Alex Jarvis <alex.j...@gmail.com>
--
 
 

Alex Jarvis

unread,
Nov 15, 2012, 11:31:10 AM11/15/12
to reacti...@googlegroups.com
Awesome, thanks!

I had to add jerkson as dependency in my Build.scala because it was removed from Play - don't tell pascal! ;)

Not sure if I like the idea of writing lots of boilerplate for each case class I have, so looking for decent alternatives and have spotted https://github.com/FasterXML/jackson-module-scala

--
 
 

Mushtaq Ahmed

unread,
Nov 15, 2012, 12:01:55 PM11/15/12
to reacti...@googlegroups.com

Alex Jarvis

unread,
Nov 15, 2012, 12:09:23 PM11/15/12
to reacti...@googlegroups.com
No I have not, thank you!

So it looks like you can just specify the implicit reads or writes for an object without having to write something for each attribute?

--
 
 

Pascal Voitot Dev

unread,
Nov 15, 2012, 12:10:04 PM11/15/12
to reacti...@googlegroups.com
yes it is and it's compile-time and typesafe ;) (a bit experimental yet but it works pretty well)


--
 
 

Nick Fisher

unread,
Nov 15, 2012, 11:41:29 PM11/15/12
to reacti...@googlegroups.com
Hi Stephane,

Does the upgrade to scala 2.10 happen to include a fix for this issue https://groups.google.com/forum/ #! topic / play-framework / oVZZl_K_dtI by any chance?  If not, do you have any idea when a fix might be available?  I'm trying to determine if it is worth holding off deployment of my app for a little bit to get the upgrade, or go ahead with deployment using my (admittedly awful) work-around for now.

Thanks,
Nick

Pascal Voitot Dev

unread,
Nov 15, 2012, 6:08:03 AM11/15/12
to reacti...@googlegroups.com
If you want to use ReactiveMongo with Play2.1+Scala 2.10, yes you should use a recent play2.1 snapshot.
Current master is quite stable so you can clone it and compile it.

As soon as there is a RCx (which should be soon), stephane will create a stable package.

Pascal


--
 
 

Pascal Voitot Dev

unread,
Nov 15, 2012, 12:05:09 PM11/15/12
to reacti...@googlegroups.com
Yes sure, I've seen it because I've coded it :D



--
 
 

Alex Jarvis

unread,
Nov 15, 2012, 12:12:43 PM11/15/12
to reacti...@googlegroups.com
It's like christmas has come early or something :)

--
 
 

Alex Jarvis

unread,
Nov 16, 2012, 3:38:40 AM11/16/12
to reacti...@googlegroups.com
Hi Pascal,

I've managed to convert my code to using the reads/writes implicits, but in one case I require a format implicit which does not seem to work. I am declaring the implicit val inside the object of the case class like so (which works for reads, or writes):

import play.api.libs.json._
import play.api.libs.json.Json
import play.api.libs.json.util._
import play.api.libs.json.Writes._
import play.api.libs.json.Reads._
import play.api.libs.json.Format._

case class AccessTokenError(
  error: String,
  error_description: String,
  error_uri: String
)

object AccessTokenError {
  implicit val format = Json.format[AccessTokenError]
}

but get the following error:
[error] /Users/alex/github/meep/app/dtos/oauth/AccessTokenError.scala:17: type mismatch;
[error]  found   : dtos.oauth.AccessTokenError.type
[error]  required: (String, String, String) => dtos.oauth.AccessTokenError
[error]  Note: implicit value format is not applicable here because it comes after the application point and it lacks an explicit result type
[error]   implicit val format = Json.format[AccessTokenError]
[error]                                    ^

Also another issue I had was where I had a custom apply function in my object, the writes macro did not work and I had to remove it.. I would expect the macro to work with custom apply functions, so I guess this might not have been tested yet?

[error] exception during macro expansion: 
[error] scala.ScalaReflectionException: value apply encapsulates multiple overloaded alternatives and cannot be treated as a method. Consider invoking `<offending symbol>.asTerm.alternatives` and manually picking the required method
[error] at scala.reflect.api.Symbols$SymbolApi$class.asMethod(Symbols.scala:247)
[error] at scala.reflect.internal.Symbols$SymbolContextApiImpl.asMethod(Symbols.scala:73)
[error] at play.api.libs.json.Json$.writesImpl(Json.scala:433)
[error] /Users/alex/github/meep/app/controllers/Files.scala:56: No Json deserializer found for type dtos.GridFSFileDTO. Try to implement an implicit Writes or Format for this type.

It would be appreciated if you could look into the format issue and if necessary I can create a sample project which produces the error.

Thanks for all the great work!

--
 
 

Eric Reichert

unread,
Nov 22, 2012, 10:27:38 AM11/22/12
to reacti...@googlegroups.com
When was this commit supposed to take place.  I ran an sbt update this morning and I'm still seeing A LOT of these debug lines and, ironically, it's making debugging a pain in the neck.

Stephane Godbillon

unread,
Nov 22, 2012, 11:27:37 AM11/22/12
to reacti...@googlegroups.com
Hi,

Are you sure SBT downloaded the last jars ? I just tested with tailable cursors demo with a fresh git clone, there is no more DebuggingPromise output. AFAIR I committed this cleanup some days ago, and the jars on the repository are updated (2.10-RC1 and 2.10-RC2 versions).


2012/11/22 Eric Reichert <ericdr...@gmail.com>
--
 
 

Eric Reichert

unread,
Nov 22, 2012, 12:00:47 PM11/22/12
to reacti...@googlegroups.com
While I used the Build.sbt file from the tailable cursors example, for some reason I had to explicitly declare scalaVersion then run clean and update.  I'm good.  Thanks.

Stephane Godbillon

unread,
Nov 25, 2012, 11:51:14 AM11/25/12
to reacti...@googlegroups.com
Hi Nick,

I identified the problem (located in play-iteratees), I'm currently working with the Play team on this issue. Should be fixed in the next days :)
2012/11/16 Nick Fisher <nfish...@gmail.com>

--
 
 

Stephane Godbillon

unread,
Jan 7, 2013, 7:25:40 PM1/7/13
to reacti...@googlegroups.com
Hi Nick,

I have just pushed a fix for the bug regarding large cursors. The root cause is located in the Scala concurrent library itself (see https://issues.scala-lang.org/browse/SI-6932), but my last commit does solve the problem right now.

Can you test with your application and confirm that it works for you?

Thank you,
2012/11/25 Stephane Godbillon <stephane....@gmail.com>

Nick Fisher

unread,
Jan 10, 2013, 3:25:49 PM1/10/13
to reacti...@googlegroups.com
Hi Stephane,

I just upgraded to your latest snapshot.  I've tested it locally, and it appears to work.  I'll do some further testing in our staging environment soon, but it looks like you've fixed the issue.

Thanks for all your help, it's much appreciated.

-Nick
Reply all
Reply to author
Forward
0 new messages