Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception during starting memcached in Play2.3.7 #40

Open
irshad-k opened this issue Jul 14, 2015 · 5 comments
Open

Exception during starting memcached in Play2.3.7 #40

irshad-k opened this issue Jul 14, 2015 · 5 comments

Comments

@irshad-k
Copy link

Hi,

Firstly, thanks for such a great plugin and the good work you are doing.
I am trying to use memcached in my project (play2.3.7, java8) and using this plugin version 0.7.0 (play2-memcached-play23_2.11-0.7.0) along with spymemcached-2.9.1 but I get the following exception and application fails to start. I need to get this up and going as my project is going live shortly.

play.api.Application$$anon$1: Execution exception[[NullPointerException: null]]
at play.api.Application$class.handleError(Application.scala:296) ~[play_2.11-2.3.7.jar:2.3.7]
at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.11-2.3.7.jar:2.3.7]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.11-2.3.7.jar:2.3.7]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.11-2.3.7.jar:2.3.7]
at scala.Option.map(Option.scala:145) [scala-library-2.11.1.jar:na]
Caused by: java.lang.NullPointerException: null
at com.github.mumoshu.play2.memcached.MemcachedPlugin$$anon$2.get(MemcachedPlugin.scala:106) ~[play2-memcached-play23_2.11-0.7.0.jar:0.7.0]
at play.api.cache.Cache$.get(Cache.scala:80) ~[play-cache_2.11-2.3.7.jar:2.3.7]
at play.api.cache.Cache.get(Cache.scala) ~[play-cache_2.11-2.3.7.jar:2.3.7]
at play.cache.Cache.get(Cache.java:19) ~[play-cache_2.11-2.3.7.jar:2.3.7]

Looking forward for your help in resolving this issue.

Regards,
Irshad

@mumoshu
Copy link
Contributor

mumoshu commented Jul 14, 2015

@irshad-k Hi, thanks for your interest in the plugin :)

Did you pass nulls as keys to Cache.get?
If so, please don't.
You should always pass non null string values to Cache.get because keys are necessary to communicate with key-value stores like Memcached.

Regards,
Yusuke

@mumoshu
Copy link
Contributor

mumoshu commented Jul 24, 2015

Hi @irshad-k!
Could you get your issue resolved?
Don't hesitate to reopen this issue if not.

@mumoshu mumoshu closed this as completed Jul 24, 2015
@irshad-k
Copy link
Author

The issue is not with passing null as key.. I have been using this plugin since play 2.1 and version 0.30 and everything was working fine.. Now I upgraded to play 2.3.7 and memcached 0.7.0 and everything just stops working and I get this above posted stack trace..
Now, I have rolled back to play 2.1 until this issue is resolved.

@irshad-k
Copy link
Author

Could you please reopen the issue..I m not able to find the button or link to reopen the issue.
Thanks

@mumoshu mumoshu reopened this Jul 24, 2015
@mumoshu
Copy link
Contributor

mumoshu commented Jul 24, 2015

@irshad-k Thanks for your response! I've reopened this issue.

I wonder if I've missed something, but the stack trace you've shared:

Caused by: java.lang.NullPointerException: null
at com.github.mumoshu.play2.memcached.MemcachedPlugin$$anon$2.get(MemcachedPlugin.scala:106) ~[play2-memcached-play23_2.11-0.7.0.jar:0.7.0]

seems to point this line as the source of NullPointerException:

https://github.com/mumoshu/play2-memcached/blob/v0.7.0/plugin/src/main/default/com/github/mumoshu/play2/memcached/MemcachedPlugin.scala#L106

Could I have an example Play2 app to reproduce the issue without null keys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants