Could not initialize class ...CookieAuthenticator


Hi all,

I have a strange issue and I hope I am just missing something simple. I changed my slick db url from H2 to postgres as I prepare to deploy and everything was going smoothly until I tried to run the app. I am now getting java.lang.NoClassDefFoundError: could not initialize class$ at$$anonfun$retrieve$3.apply(CookieAuthenticator.scala:209)

I would have thought nothing should have changed, but this has me completely stumped.

I am using play 2.5 and Silhouette 4.

Thanks in advance,


As I dig further into this, it appears that my play json is missing DefaultJodaDateWrites. The error I now get is java.lang.NoSuchMethodError: play.api.libs.json.Writes$.DefaultJodaDateWrites()Lplay/api/libs/json/DefaultWrites$DefaultJodaDateWrites$;

It makes sense that if the cookie authenticator cannot write itself to json, then it is not going to work. However, should I file a bug with Play framework because all of the information I have found says the joda time will be removed from Play-json in play 2.6. I am not sure how I have run into this as my Play version is 2.5.14.

Thanks again.


Have you tried to clean yor cache with sbt clean? If that doesn’t help try to delete your ivy cache.


Hi Akkie,

Thanks for your response. I figured out the issue was slick-pg calls in play-json 2.6. Once I removed that dependency, everything is function again.