Play Framweok + Mongo Scala driver + LocalDate
up vote
0
down vote
favorite
I'm coding services which use case classes with LocalDate property. Previous implementations didn't have any issues with LocalDate codec, but one service is having trouble with the LocalDate codec.
I have this line in my code:
private val javaCodecs =
fromCodecs(new LocalDateTimeDateCodec(), new LocalDateDateCodec())
And I get this when running tests of the service:
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.joda.time.LocalDate.
The LocalDate is org.joda.time.LocalDate
because of the Play framework JSON serialization. Other services have no issues with this. What can be the problem?
json mongodb scala playframework localdate
add a comment |
up vote
0
down vote
favorite
I'm coding services which use case classes with LocalDate property. Previous implementations didn't have any issues with LocalDate codec, but one service is having trouble with the LocalDate codec.
I have this line in my code:
private val javaCodecs =
fromCodecs(new LocalDateTimeDateCodec(), new LocalDateDateCodec())
And I get this when running tests of the service:
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.joda.time.LocalDate.
The LocalDate is org.joda.time.LocalDate
because of the Play framework JSON serialization. Other services have no issues with this. What can be the problem?
json mongodb scala playframework localdate
What's the underlying Java driver version being used here? This has been present for quite a few releases now. Mind these arejava.time.LocalDate
etc. JSON is not BSON, so anything else needs a mapping between them. I would have thoughtorg.joda.time.LocalDate
would have abstracted from thejava.time
namespace anyway.
– Neil Lunn
yesterday
"org.mongodb.scala" %% "mongo-scala-driver" % "2.2.1" - this is the mongo driver, Java is 1.8
– BPetike
yesterday
Okay should be java driver3.6.3
, which is as noted before the patches are introduced. So2.2.1
is quite old, and2.5.0
is actually current. I suggest you update your project dependencies.
– Neil Lunn
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm coding services which use case classes with LocalDate property. Previous implementations didn't have any issues with LocalDate codec, but one service is having trouble with the LocalDate codec.
I have this line in my code:
private val javaCodecs =
fromCodecs(new LocalDateTimeDateCodec(), new LocalDateDateCodec())
And I get this when running tests of the service:
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.joda.time.LocalDate.
The LocalDate is org.joda.time.LocalDate
because of the Play framework JSON serialization. Other services have no issues with this. What can be the problem?
json mongodb scala playframework localdate
I'm coding services which use case classes with LocalDate property. Previous implementations didn't have any issues with LocalDate codec, but one service is having trouble with the LocalDate codec.
I have this line in my code:
private val javaCodecs =
fromCodecs(new LocalDateTimeDateCodec(), new LocalDateDateCodec())
And I get this when running tests of the service:
org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.joda.time.LocalDate.
The LocalDate is org.joda.time.LocalDate
because of the Play framework JSON serialization. Other services have no issues with this. What can be the problem?
json mongodb scala playframework localdate
json mongodb scala playframework localdate
asked yesterday
BPetike
186
186
What's the underlying Java driver version being used here? This has been present for quite a few releases now. Mind these arejava.time.LocalDate
etc. JSON is not BSON, so anything else needs a mapping between them. I would have thoughtorg.joda.time.LocalDate
would have abstracted from thejava.time
namespace anyway.
– Neil Lunn
yesterday
"org.mongodb.scala" %% "mongo-scala-driver" % "2.2.1" - this is the mongo driver, Java is 1.8
– BPetike
yesterday
Okay should be java driver3.6.3
, which is as noted before the patches are introduced. So2.2.1
is quite old, and2.5.0
is actually current. I suggest you update your project dependencies.
– Neil Lunn
yesterday
add a comment |
What's the underlying Java driver version being used here? This has been present for quite a few releases now. Mind these arejava.time.LocalDate
etc. JSON is not BSON, so anything else needs a mapping between them. I would have thoughtorg.joda.time.LocalDate
would have abstracted from thejava.time
namespace anyway.
– Neil Lunn
yesterday
"org.mongodb.scala" %% "mongo-scala-driver" % "2.2.1" - this is the mongo driver, Java is 1.8
– BPetike
yesterday
Okay should be java driver3.6.3
, which is as noted before the patches are introduced. So2.2.1
is quite old, and2.5.0
is actually current. I suggest you update your project dependencies.
– Neil Lunn
yesterday
What's the underlying Java driver version being used here? This has been present for quite a few releases now. Mind these are
java.time.LocalDate
etc. JSON is not BSON, so anything else needs a mapping between them. I would have thought org.joda.time.LocalDate
would have abstracted from the java.time
namespace anyway.– Neil Lunn
yesterday
What's the underlying Java driver version being used here? This has been present for quite a few releases now. Mind these are
java.time.LocalDate
etc. JSON is not BSON, so anything else needs a mapping between them. I would have thought org.joda.time.LocalDate
would have abstracted from the java.time
namespace anyway.– Neil Lunn
yesterday
"org.mongodb.scala" %% "mongo-scala-driver" % "2.2.1" - this is the mongo driver, Java is 1.8
– BPetike
yesterday
"org.mongodb.scala" %% "mongo-scala-driver" % "2.2.1" - this is the mongo driver, Java is 1.8
– BPetike
yesterday
Okay should be java driver
3.6.3
, which is as noted before the patches are introduced. So 2.2.1
is quite old, and 2.5.0
is actually current. I suggest you update your project dependencies.– Neil Lunn
yesterday
Okay should be java driver
3.6.3
, which is as noted before the patches are introduced. So 2.2.1
is quite old, and 2.5.0
is actually current. I suggest you update your project dependencies.– Neil Lunn
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372569%2fplay-framweok-mongo-scala-driver-localdate%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What's the underlying Java driver version being used here? This has been present for quite a few releases now. Mind these are
java.time.LocalDate
etc. JSON is not BSON, so anything else needs a mapping between them. I would have thoughtorg.joda.time.LocalDate
would have abstracted from thejava.time
namespace anyway.– Neil Lunn
yesterday
"org.mongodb.scala" %% "mongo-scala-driver" % "2.2.1" - this is the mongo driver, Java is 1.8
– BPetike
yesterday
Okay should be java driver
3.6.3
, which is as noted before the patches are introduced. So2.2.1
is quite old, and2.5.0
is actually current. I suggest you update your project dependencies.– Neil Lunn
yesterday